NuGet / Home

Repo for NuGet Client issues
Other
1.5k stars 252 forks source link

Throw a helpful message when APPDATA is not set #6152

Open livarcocc opened 7 years ago

livarcocc commented 7 years ago

From @Petermarcu on November 9, 2017 17:13

@teo2akt commented on Wed Nov 08 2017

Created a new classlib project using CLI/ VS code and it's throwing dotnet restore error. I did create this new project with .NET core SDK 2.0.0

E:\t>dotnet restore C:\Program Files\dotnet\sdk\2.0.2\NuGet.targets(476,5): error : Value cannot be nul l.\r [E:\t\t.csproj] C:\Program Files\dotnet\sdk\2.0.2\NuGet.targets(476,5): error : Parameter name: pat h1 [E:\t\t.csproj] is this a known issue? and resolution?

Copied from original issue: dotnet/cli#7990

zhili1208 commented 7 years ago

@teo2akt I tried this, but can't repro it. Could you do "dotnet restore -v diag" and provide the log?

x17160715-Ashwani-Teotia commented 7 years ago

Logs attached! l.txt

emgarten commented 7 years ago

@teo2akt is the env var APPDATA set on the machine?

Based on the code here https://github.com/NuGet/NuGet.Client/blob/a5abb1bdc1aecdbc1d46f36c3eced4062843c249/src/NuGet.Core/NuGet.Configuration/Settings/Settings.cs#L324 it looks like this could be coming back empty and causing a NRE.

x17160715-Ashwani-Teotia commented 7 years ago

ENV was missed. It's resolved now, working fine. Thank You!

emgarten commented 7 years ago

Thanks for the update @teo2akt, NuGet should throw a helpful message when this happens, similar to when HOME isn't set. I'll leave this issue to track that work.