Reputation: 23462
I have basically no idea what is going on here, but I can't run the latest nuget.exe on my machine. The error I get is "Unable to find a version of the runtime to run this application". It doesn't matter if I try to use a specific nuget command or just nuget without parameters.
Any suggestions?
Upvotes: 13
Views: 7022
Reputation: 23462
Ok, so this turned out to be a really weird error which I still don't know why it happened. But I do know the solution. What I had done was put the nuget.exe
file in c:\windows\system32
. I did that so I didn't have to update the %PATH%
environment variable, or that was my thought at least. The part about not updating the environment variable worked fine, but for some reason NuGet wouldn't run from that folder for me. When putting the nuget.exe
file in a separate folder under c:\Program files (x86)
and adding that folder to the %PATH%
, it started working just fine.
Weird error.
Upvotes: 35
Reputation: 8547
Got exactly the same thing, and solved in exactly the same way.
I have a feeling that the issue is that in someway putting the exe in System32 gives it too many options about which .NET framework to use and so it panics and refuses to use any of them :)
So I'd guess that moving it out of System32 then forces it into using the machine's default, Framework or the first one in PATH or something similar, perhaps?
(Would have put all of this as a comment on Tomas' post, but I can't comment yet :(
Upvotes: 2