如果您在 .NET Core 上编写 运行s 的 C# 或 F# 程序,相同的字节码是否也会在 .NET 上 运行(没有安装 .NET Core)?
If you write a C# or F# program that runs on .NET Core, will the same bytecode also run on .NET (with no .NET Core installed)?
如果您在 .NET Core 上编写 运行 的 C# 或 F# 程序,相同的字节码是否也会 运行 在 .NET 上(未安装 .NET Core)?
我听说反射的工作方式不同,但我不清楚这些差异是否属于 API。
在 .NET Core 1.0 中有新的可能性,例如能够 运行 您的应用程序基于 .NET Core 平台或传统的 .NET Framework 4.5.x。环境设置取决于应用程序类型(便携式或独立应用程序)和目标框架。
来自 .NET Core Application Deployment 文档:
You can deploy your .NET Core app in either of two ways:
As a portable app. A portable app relies on a shared system-wide
version of .NET Core to be present on the target system. Because .NET
Core is already present, your app is portable between installations of
.NET Core. Your app contains only its own code and any third-party
dependencies that are outside of the .NET Core libraries. Portable
applications are .dll files that can be launched by using the dotnet
utility from the command line. For example, dotnet app.dll runs a
portable application named app.
As a self-contained application. Unlike a portable app, a
self-contained app does not rely on any shared components to be
present on the target system. All components, including both .NET Core
libraries and the .NET Core runtime, are included with the application
and are isolated from other .NET Core applications. Self-contained
applications include an executable (such as app.exe on Windows
platforms for a self-contained application named app), which is a
renamed version of the platform-specific .NET Core host, and a .dll
file (such as app.dll), which is the actual application.
关于指定框架(阅读更多内容here)
The “framework” section in project.json specifies the framework or
list of frameworks supported by your app.
The “imports” section in
project.json is a way to use packages/libraries that are not based on
the same version than your target Core platform version, such as
“dnxcore” and portable-* libs, as shown below in one of the examples.
It is important to use “imports” only for versions of .NET Core and
PCL (Portable Class Libraries). Using it with TFMS from the
traditional .NET Framework can cause issues or malfunction.
When supporting multiple frameworks in your app, you can selectively run
your app on top of one or the other framework by selecting that
default framework from Visual Studio or from the command line (as
explained below).
如果您在 .NET Core 上编写 运行 的 C# 或 F# 程序,相同的字节码是否也会 运行 在 .NET 上(未安装 .NET Core)?
我听说反射的工作方式不同,但我不清楚这些差异是否属于 API。
在 .NET Core 1.0 中有新的可能性,例如能够 运行 您的应用程序基于 .NET Core 平台或传统的 .NET Framework 4.5.x。环境设置取决于应用程序类型(便携式或独立应用程序)和目标框架。
来自 .NET Core Application Deployment 文档:
You can deploy your .NET Core app in either of two ways:
As a portable app. A portable app relies on a shared system-wide version of .NET Core to be present on the target system. Because .NET Core is already present, your app is portable between installations of .NET Core. Your app contains only its own code and any third-party dependencies that are outside of the .NET Core libraries. Portable applications are .dll files that can be launched by using the dotnet utility from the command line. For example, dotnet app.dll runs a portable application named app.
As a self-contained application. Unlike a portable app, a self-contained app does not rely on any shared components to be present on the target system. All components, including both .NET Core libraries and the .NET Core runtime, are included with the application and are isolated from other .NET Core applications. Self-contained applications include an executable (such as app.exe on Windows platforms for a self-contained application named app), which is a renamed version of the platform-specific .NET Core host, and a .dll file (such as app.dll), which is the actual application.
关于指定框架(阅读更多内容here)
The “framework” section in project.json specifies the framework or list of frameworks supported by your app.
The “imports” section in project.json is a way to use packages/libraries that are not based on the same version than your target Core platform version, such as “dnxcore” and portable-* libs, as shown below in one of the examples. It is important to use “imports” only for versions of .NET Core and PCL (Portable Class Libraries). Using it with TFMS from the traditional .NET Framework can cause issues or malfunction.
When supporting multiple frameworks in your app, you can selectively run your app on top of one or the other framework by selecting that default framework from Visual Studio or from the command line (as explained below).