与其他.NET Framework和Mono框架一起运行.NET Core

Running .NET Core with other .NET Frameworks and Mono Framework

我刚刚读到某个地方,它看起来像是" project.json "文件中" frameworks "下的" imports "选项,让您的应用程序使用计算机中安装的其他.NET Framework作为如果.NET Core仍不支持您的库,则进行回退。如果是这样,我是否可以在.NET Core项目中通过.NET 4.x使用诸如GTK#之类的库?以及如何使我的应用程序在非MS Windows系统上与Mono Framework一起运行?


I just read somewhere that it looks like the"imports" option under"frameworks" in"project.json" file let's your application use the other .NET Frameworks installed in your machine as fallback if your libraries still not yet supported in the .NET Core.

不。 "imports"使您的项目可以使用尚不直接支持netstandard的库。实际上,只有在库仅使用netstandard暴露的表面(包括.Net Core RC1库(dnxcore50)和使用某些可移植配置文件的库)时,此方法才起作用。

will I be able to use libraries such as GTK# through .NET 4.x with my .NET Core project?

您可以使用project.json / dotnet /。Net Core CLI编写一个.Net Framework 4.x应用程序(例如,在"frameworks"中使用"net451"),但是结果是一个.Net Framework应用程序,不是.Net Core应用程序。当您正在编写库并想要拥有.Net Core / netstandard版本和.Net Framework的另一个版本时,这最有用。

And how make my application run with Mono Framework on a non-MS Windows system?

如果您正在编写.Net Core应用程序,则不需要mono。如果您正在使用.Net Core CLI编写.Net Framework应用程序,则不支持mono,它可能会或可能不会起作用。如果您正在编写.Net Framework应用程序并希望在Mono上运行,那么它将一如既往地工作:如果您未使用Mono不支持的任何功能,那么它应该可以正常工作。