DNX does not work

你离开我真会死。 提交于 2020-01-05 07:59:12

问题


I have installed dnvm successfully on windows server 2008. but when I run "dnx", nothing shown. no error message like this:

C:\Windows\system32\dnx
C:\Windows\system32\

someone had the same problem?


回答1:


First of all you need to understand structure of DNX. By default it's installed in %USERPROFILE%\.dnx. Inside of it you should find runtimes folder containing all of installed CLRs e.g.

  • dnx-clr-win-x86.1.0.0-beta4
  • dnx-clr-win-x86.1.0.0-beta6-11938

Each of them has its own bin folder with dnx.exe and dnu.cmd. These are the ones you are looking for. So basically after executing dnvm upgrade (as suggested by @tugberk) DNVM installs latest DNX from feed, marks it as default and adds it to user's PATH variable. Your PATH might has not been updated for some reason and I suggest you do it manually by including path to your desired CLR version.

It is also possible to install CLR to machine-wide location by adding -g flag.

After try to run: C:\>dnx

Output:

Microsoft .NET Execution environment CLR-x86-1.0.0-beta6-11938
Usage: dnx [options] ...

Detailed documentation on DNVM - ASP.NET Home / Version Manager




回答2:


Installing DNVM doesn't mean you also installed DNX. Run the following command the get the latest stable release:

dnvm upgrade

Then you should be able to run dnx and dnu.




回答3:


You can run different versions of dnvm simultaneously on the same machine, so the installer doesn't set the value for dnx in the user's PATH variable as part of the install because, if you already had another version of dnvm installed, that could lead to unexpected results for anything using the existing version.

If you want to see what's going, then do the following (paraphrasing from another answer I wrote on this issue):

first do:

dnvm upgrade

This gets the most up to date version of dnvm and sets it as the default for that command prompt session.

Then you can list out all the versions of ASP.NET 5 installed on your machine as follows:

dnvm list

You can then set one of the items in that list as the default with e.g. (NB: the actual version may be different depending on when you view this answer):

dnvm use 1.0.0-rc1-update1 -r clr -arch x64 -p

The -p on the end means 'persist' and that is the setting that will then persist the default you just selected to both the process (session) PATH and also the user PATH variable. Persisting to the user PATH means the default is then available everywhere.

If you leave off the -p then you can select a version just for use in that command prompt session.

After that you should be able to use dnx as expected.



来源:https://stackoverflow.com/questions/30354117/dnx-does-not-work

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!