Fancy.CoreClrHost published

Tags: .NET Core

In my previous blog post I showed you how you can host the .NET Core Clr in your own process. Now I published an open source project for a .NET Core Clr host using the code snippets of in the previous post. The project is called Fancy.CoreClrHost and you can find it here at my GitHub repository

What can you do with Fancy.CoreClrHost

Imagine you have a simple class library compiled into IL in an assembly file. If your class library has no dependencies to the full .NET Framework but only dependencies to nuget packages you are able to deploy and run your application without any dependency to the full .NET Framework.

How can I do this

Add nuget dependencies to CoreClr and to Fancy.CoreClrHost to your class library. Be aware the CoreClr nuget package is currently available at the aspvnet myget feed only. The Fancy.CoreClrHost package you can get already from nuget.org. Within the package Fancy.CoreClrHost you can find an executeable. You have to call this executeable with the arguments set correctly. See the readme file at the GitHub repository for more specific instructions.

Behind the scenes

What happens behind the scenes is that Fancy.CoreClrHost loads the .NET Core Clr at the path you provided. Then it loads your assembly with all its dependencies into an App Domain. Within this App Domain Fancy.CoreClrHost searches for the type and the method you specified by the arguments. If it has found this method it calls it. 

Hope it helps!

No Comments

Add a Comment