简体   繁体   English

将dotnet核心(.NET Core)嵌入到Windows / Linux上的本机应用程序中

[英]Embed dotnet core (.NET Core) into native applications on Windows/Linux

Are there possibilities to embed dotnet core (.NET Core) environments into native processes? 是否有可能将dotnet核心(.NET Core)环境嵌入到本机进程中?

My use-case would be an existing game-server where I want to offer the possibility to extend the game using C# on .NET Core on both Windows and Linux. 我的用例是现有的游戏服务器,我想在Windows和Linux上使用C#在.NET Core上扩展游戏。

Bonus question: would there also be an AppDomain -concept available like in "oldschool" .NET? 奖金问题:是否还有像“oldschool”.NET一样的AppDomain概念?

Yes, it is definitely possible. 是的,这绝对是可能的。

I found this documentation with examples: .NET Core Hosting Tutorial 我在这个文档中找到了一些示例: .NET Core Hosting Tutorial

If the link does not work anymore, search the web for "hosting .NET Core". 如果该链接不再起作用,请在Web上搜索“托管.NET Core”。

About AppDomains ... I guess not. 关于AppDomains ...我猜不是。 If you use CoreClrHost.h you can provide an ID for the default AppDomain, but it seems to be the one and only AppDomain. 如果您使用CoreClrHost.h,您可以为默认的AppDomain提供ID,但它似乎是唯一的AppDomain。 For isolation you can use seperate processes. 对于隔离,您可以使用单独的进程。 Maybe AssemblyLoadContext class can also be a help to you. 也许AssemblyLoadContext类也可以帮到你。

AppDomain is not coming to dotnet core. AppDomain不会来到dotnet核心。 Parts of the AppDomain api will come over, but nothing directly related to the functionality you speak of. AppDomain api的部分内容将会出现,但与您所说的功能没有任何直接关系。 I don't believe you can embed dotnet core applications inside a native process, however inside of a native process you could boot a dotnet core process. 我不相信你可以在本机进程中嵌入dotnet核心应用程序,但是在本机进程中你可以启动一个dotnet核心进程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM