Giter VIP home page Giter VIP logo

fancy.coreclrhost's Introduction

Fancy.CoreClrHost

A host application to start .NET Core Crl with user defined assemblies.

##What is Fancy.CoreClrHost Fancy.CoreClrHost enables you to start .NET Code (IL) assemblies using the .NET Core Clr runtime. The assembly which you want to run may not have dependencies to assemblies of the full .NET Framework (no directly and also no indirectly references). Use only nuget packages.

How to use it

Add the Fancy.CoreClrHost nuget package and the CoreClr package to your project (currently you can get the CoreClr package from the aspnetvnext package feed located at myget.org.

Within your project create a static method which takes no arguments and has no return value. This is the entry point into you .NET code.

Compile your project and call Fancy.CoreClrHost.exe with the following command line arguments:

  • --CoreClrFolderPath: Path to folder containing coreclr (The contents of the CoreClr nuget package).
  • --AppFolderPath: Path to the folder containing your .NET assemblies you wand to execute code from.
  • --EntryPointAssemblyName: The name of the assembly containing your entry point.
  • --EntryPointTypeName: The name of the type containing the method you want to start.
  • --EntryPointMethodName:The name of the method you want to run.

Example

Imagine we have the follwing .NET Code compiled into an assembly:

namespace CoreClrExampleAssembly
{
    public class Program
    {
        public static int Main()
        {
            Console.WriteLine("Hello .NET Core");
            Console.ReadLine();
        }
    }
}

Lets assume the compiled code of the example can be found at C:\Dev\CoreClrExampleAssembly.dll and the contents of the CoreClr package at C:\Dev\CoreClr.

To run the main method using CoreClr you have to use the follwing command line.

Fancy.CoreClrHost.exe --CoreClrFolderPath:C:\Dev\CoreClr\Runtime\x86\ --AppFolderPath:C:\Dev\ --EntryPointAssemblyName:CoreClrExampleAssembly --EntryPointTypeName:CoreClrExampleAssembly.Program --EntryPointMethodName:Main

Known Issues

  • Currently all paths you provide need to be absolute path and need to end with a backslash.
  • Debugging with Visual Studio is possible but only if you attach the debugger when the application is already running. Directly starting the application from Visual Studio with the Debugger (F5) is currently not possible.

More Information:

To get some background you can also read my blog posts:

http://www.fancy-development.net/fancy-coreclrhost-published http://www.fancy-development.net/hosting-net-core-clr-in-your-own-process

fancy.coreclrhost's People

Contributors

fancydevelopment avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.