-
Notifications
You must be signed in to change notification settings - Fork 258
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ArgumentNullException thrown from NuGet.PackageManagement.VisualStudio.VSSettings.ResetSolutionSettings() #1408
Comments
I'm guessing it is coming from here:
In what scenario can the solution be closed and the folder be null? The code obviously allows for that, see here: So it seems the settings check should simply check for null instead of looking at IsSolutionOpen |
The exception is |
@AArnott , That makes sense. We will fix it. Little bit of history on this issue below In VS 2013, NuGet would treat the File->NewFile solution and an unsaved solution (when the project file is directly opened or if a newly created project is not saved by default) as the same. Meaning, NuGet will be unsupported in those scenarios. Because, NuGet needs the solution directory to install packages and does not want to use the SolutionDirectory from an unsaved solution or if it is not available. In fact, SolutionManager will 'false' for SolutionManager.IsSolutionOpen and null for SolutionManager.SolutionDirectory, even though, the solution is actually open and not null for unsaved solutions. We have changed this in NuGet3, where in, NuGet may be supported even if a solution is unsaved, so long as the packages folder does not depend on the SolutionDirectory. For example, UWP applications with a default globalPackagesFolder. Even in that case, we use the SolutionDirectory from DTE for loading NuGet settings. In addition, SolutionManager.IsSolutionOpen and SolutionManager.SolutionDirectory return what DTE returns and do not have overloaded definitions :) Looks like we have missed the File->New File scenario, where in SolutionManager.IsSolutionOpen is true but, SolutionManager.SolutionDirectory is null. Hence, an attempt to load NuGet settings fail, in case of File->New File scenario. Will fix it |
This issue seems to be more prominent when Xamarin is installed into Visual Studio 2015. So raising the priority to 0 as it blocks Visual Studio Update I. The manifestation in this case is that no file can be opened. |
Fix was pushed into the 3.2.1 branch, and the PR is open on 3.3, waiting for 3.3 branch to open |
Resolved with NuGet/NuGet.Client@d4a128f |
NuGet VS extension version: 3.2.60914.10516
The ArgumentNullException is thrown from Path.Combine when it is called from here.
The activity log contained this exception:
The text was updated successfully, but these errors were encountered: