NuGet / Home

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

NuGet Manage Packages for Solution fails to open if the solution is not saved. #4562

Open rrelyea opened 7 years ago

rrelyea commented 7 years ago

vsfeedback 804239 - https://developercommunity.visualstudio.com/content/problem/18837/nuget-manage-packages-for-solution-fails-to-open.html

Using the dotnet core from build 26206.00 Using the command line create a new dotnet core MVC app (dotnet new mvc --auth None) dotnet restore and dotnet run to hydrate and test the app Using visual studio open the csproj file (note at present there is no solution file present on disk - dotnet new does not produce one) Go Tools->Nuget Package Manager->manage Nuget packages for Solution An error dialog appears with HResult E_INVALIDARG (see attachment) Save the solution file (creates a real solution file on disk) Go Tools->Nuget Package Manager->manage Nuget packages for Solution The package manager now opens sucessfully. This is repeatable. It seems that a check is required to ensure that a solution file is present before using the package manager

mishra14 commented 7 years ago

trying to get a machine and then repro

mishra14 commented 7 years ago

unable to repro this. In my case dotnet new mvc --auth nonedid create a csproj file. I was able to open the project and update all packages

Update - Got a repro on manage packages for solution. Debugging.

grbsystems commented 7 years ago

capture

Until I have a solution file it does this every time. I may try it on a totally clean (as opposed to continually upgraded) install.

rrelyea commented 7 years ago

Workaround: Save All or ctrl-shift-S (which saves solution) Then it works.

grbsystems commented 7 years ago

That is mentioned in the original problem report.

mishra14 commented 7 years ago

I observed the same behavior for VS 2015 and VS2017 (Non netcore projects) on File -> New Project -> Delete solution file -> Manage NuGet Packages for Solution.

This can be fixed by adding a dialog prompt for the user asking them to save the solution.