What's the difference between and ?

.net .net-core entity-framework nuget visual-studio

Accepted Answer

The TargetFramework is utilised by NuGet to resolve dependencies and choose the assets that will be used for the application's compilation and construction. (In the background, other attributes suchTargetFrameworkMoniker and TargetFrameworkVersion come into play, but the SDK simplifies it by abstracting it.TargetFramework for frameworks that it is aware of).

The RuntimeFrameworkVersion is particular to.NET Core/netcoreapp A reliance on will be injected by the SDK.Microsoft.NETCore.App because of the versionRuntimeFrameworkVersion is configured to utilise or set to the most recent version of.NET Core 2.0 it is aware of. It then writes the resolved version to theruntimeconfig.json file that the.NET Core host framework resolver may use to determine the shared framework version to load (for example,.NET Core 1.1.4 runtime).

The cause of your ability to utilise1.1.* for netcoreapp1.0 is because the tools required to create.NET Core 1.0.* apps are included in the NuGet package. Because the tooling is unaware of this, you will get a.NET Core 1.0 application, but the 1.1 framework will be used to load it.runtimeconfig.json file.

The key distinction is:

  • For self-contained executables, only the version ofMicrosoft.NETCore.App is employed.
    • If you use this package to conduct a self-contained publish (like, say, a blog post), the whole framework will be imported with the appropriate version.dotnet publish -r win7-x64 )
    • When you use a programme created for1.0.3 nevertheless you possess the1.0.5 installed runtime, the1.0.5 Runtime will automatically be employed.
    • Unless you do, theRuntimeFrameworkVersion When a new version of the SDK is published that is aware of updated patches for.NET Core, it will automatically utilise the most recent version. If you specifically specify the version, you could not be current without changing the project file.
  • The RuntimeFrameworkVersion is also the minimal runtime that, if set to, the programme will load1.0.4 and attempt to run on a device with merely1.0.3 the programme won't launch after installation until you modify theruntimeconfig.json file.
  • RuntimeFrameworkVersion may be set to a floating version, ideal for targeting daily builds or preview versions, for example.2.1.0-preview1-* would arrive at the most recentpreview1 version accessible through the set up NuGet feeds.

Other than this, there are only a few justifications for building using a more advanced version ofMicrosoft.NETCore.App , such as a workaround for a build problem inDiaSymReader component.

Version 2.0 of.NET Core isRuntimeFrameworkVersion is and always2.0.0 since the dependencies of "portable programmes" (non-self contained) no longer offer the framework's implementationMicrosoft.NETCore.App and this NuGet package is exclusively used to provide compilation-related reference assemblies.

10/16/2017 8:13:16 PM

Popular Answer


Related Questions


Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow