简体   繁体   English

ASP.NET 5中的.NET版本

[英].NET versions in ASP.NET 5

In the new ASP.NET 5 projects, there are multiple ways / places to control the .NET versions: 在新的ASP.NET 5项目中,有多种方法/位置来控制.NET版本:

  • In global.json global.json
  • In Project -> Properties, Application tab, Solution DNX SDK Version (this is the same as the global.json) 在Project - > Properties,Application选项卡,Solution DNX SDK Version(这与global.json相同)
  • In Project -> Properties, Debug tab, Use Specific Runtime 在项目 - >属性,调试选项卡,使用特定运行时
  • In Package Manager Console, using dnvm list 在包管理器控制台中,使用dnvm list
  • In a normal console in the application root, using dnvm list 在应用程序根目录中的正常控制台中,使用dnvm list

Which of these are the same (apart from the first two) and what do they all do? 哪一个是相同的(除了前两个),他们都做了什么?

The dnx in global.json is only used by VS. dnx中的global.json仅供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. 没有其他人使用它,如果您在VS之外运行应用程序,则无法保证它将使用该版本。

The dnx used to run a particular application is set in two ways: 用于运行特定应用程序的dnx有两种设置:

  1. Either pass the full path to a particular dnx . 将完整路径传递给特定的dnx Eg: C:\\dnx\\dnx.exe . run 例如: C:\\dnx\\dnx.exe . run C:\\dnx\\dnx.exe . run
  2. The dnx on the PATH resolved according to your OS' PATH resolution (we don't control that). PATH上的dnx根据您的dnx解析(我们无法控制)来解决。

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. 当您运行dnvm use <version> ,该特定版本将添加到路径中,并且该特定进程将使用它并且它是子进程。 If you run dnvm use -p <version> , that version of dnx is added to the user's PATH in addition to the process' PATH. 如果运行dnvm use -p <version> ,除了进程'PATH之外, dnx将该版本的dnx添加到用户的PATH中。

For VS, if no version is specified in global.json by default it uses the dnx under the default alias. 对于VS,如果默认情况下global.json没有指定版本,则它使用default别名下的dnx The default alias is updated when you run dnvm upgrade or dnvm use -p 运行dnvm upgradednvm use -p时会更新默认别名

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM