Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.NET versions in ASP.NET 5

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

  • In global.json
  • In Project -> Properties, Application tab, Solution DNX SDK Version (this is the same as the global.json)
  • In Project -> Properties, Debug tab, Use Specific Runtime
  • In Package Manager Console, using dnvm list
  • In a normal console in the application root, using dnvm list

Which of these are the same (apart from the first two) and what do they all do?

like image 792
Sean Avatar asked Nov 10 '22 07:11

Sean


1 Answers

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

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

  1. Either pass the full path to a particular dnx. E.g: C:\dnx\dnx.exe . run
  2. The dnx on the PATH resolved according to your OS' PATH resolution (we don't control that).

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

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

like image 188
Victor Hurdugaci Avatar answered Dec 21 '22 11:12

Victor Hurdugaci