运行 .NET Core 与其他 .NET Framework 和 Mono Framework

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

我刚刚在某处读到它看起来像 "project.json" 文件中 "frameworks" 下的 "imports" 选项让您的应用程序使用安装在您计算机中的其他 .NET Frameworks 作为后备,如果您.NET Core 仍不支持库。如果这是真的,我是否可以通过 .NET 4.x 在我的 .NET Core 项目中使用 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 应用程序,那么您不需要单声道。如果您正在使用 .Net Core CLI 编写 .Net Framework 应用程序,那么 mono is not supported 它可能会或可能不会工作。如果您正在编写 .Net Framework 应用程序并希望 运行 在单声道上使用它,那么它会像往常一样工作:如果您没有使用单声道不支持的任何东西,那么它应该可以正常工作。