The .NET Framework offers several ways to host a managed runtime. You can use mscoree.dll CorBindToRuntime ( https://msdn.microsoft.com/library/ms231419(v=vs.110).aspx ) to get the AppDomain handle via GetDefaultDomain / CreateDomain, and then load the assemblies, create object instances and call moporlib interop objects methods.
This method is deprecated, but a newer interface based on CLRCreateInstance ( https://msdn.microsoft.com/library/ms164408(v=vs.110).aspx ) provides similar capabilities. At some point you get access to COM-compatible object AppDomain and can communicate with managed code.
However, CoreCLR ( https://www.microsoft.com/net , https://github.com/dotnet/coreclr ) is missing mscoree.dll. The hosting method that allows you to execute part of the CoreCLR managed code is described in
http://www.fancy-development.net/hosting-net-core-clr-in-your-own-process
But the ICLRRuntimeHost / ICLRRuntimeHost2 interfaces do not provide a way to pass data to the called managed function, and I cannot get the calculation results. Thus, the method is applicable only if the code is called for its side effects.
What is the way to transfer data to and from managed code in CoreCLR?
No one has answered this question yet.
See related questions:
Source: https://habr.com/ru/post/1657507/More articles:Why is my Swift 3.0 decodeInteger decoder not working for integers? - iosNode.js / Mongoose / MongoDb Typescript MapReduce methods - emit () and Array.sum () - node.jsTypeError: Unable to read the "replace" property from undefined vue-resource.js: 284 - jquerymysql REPLACE INTO table with hundreds of columns - phpHow to change the table layout? - mysql-workbenchFriendship in nested C ++ classes - c ++AspNetCore gets way to wwwroot in TagHelper - c #Running django migrate in docker - djangoLet the touch area of ββthe button in React Native go to the status bar (ios) - react-nativeUsing lambda expressions to add member variables? - javaAll Articles