.NET versions in ASP.NET 5

In new ASP.NET 5 projects, there are several ways / places to control .NET versions:

  • In global.json
  • In Project -> Properties, Application tab, version of the DNX SDK solution (this is the same as global.json)
  • In the project -> Properties, Debug tab, Use a specific runtime
  • In the package manager console using dnvm list
  • In a regular console at the root of the application using dnvm list

Which of them are the same (except for the first two) and what do they all do?

+5
source share
1 answer

dnx in global.json used only by VS. No one uses it, and if you run the application outside of VS, there is no guarantee that it will use this version.

dnx used to run a particular application is installed in two ways:

  • Or pass the full path to a specific dnx . For example: C:\dnx\dnx.exe . run C:\dnx\dnx.exe . run
  • dnx in PATH is resolved according to the PATH permission of your OS (we do not control this).

When you run dnvm use <version> , this particular version is added to the path and will be used by this particular process and will be processed by the child process. If you run dnvm use -p <version> , this version of dnx added to the PATH user in addition to the "PATH" process.

For VS, if no version is specified in global.json by default, it uses dnx under the default alias. The default alias is updated when you run dnvm upgrade or dnvm use -p

+1
source

All Articles