Document NuGet.exe's MSBuild requirements #14125
Labels
Priority:2
Issues for the current backlog.
Product:NuGet.exe
NuGet.exe
Transferred issue
This issue is transferred from VSFeedback or other github repo
Type:Docs
This issue has been moved from a ticket on Developer Community.
[regression] [worked-in:17.12]
We have a large MSBuild project that does a number of VS 2022 solutions. Our first build target will do a NuGet restore of the based on a super-solution that contains all projects. This was working in VS 2022 17.12.3, but started failing when 17.13 was installed with the following:
NugetRestore:
“NuGet.exe” restore …\AllProjectsForNugetUpdates.sln
MSBuild auto-detection: using msbuild version ‘17.13.9.7704’ from ‘C:\Program Files\Microsoft Visual Studio\2022\Ente
rprise\MSBuild\Current\Bin\amd64’.
Error parsing solution file at C:_MTS\TestSuite\AllProjectsForNugetUpdates.sln: Exception has been thrown by the tar
get of an invocation. Could not load file or assembly ‘Microsoft.VisualStudio.SolutionPersistence, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. The system cannot find the file specifi
ed.
The issue seems similar to what’s being experienced on this project: microsoft/dotnet-framework-docker#1213
Original Comments
Feedback Bot on 2/16/2025, 07:05 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Rainer Sigwald [MSFT] on 2/18/2025, 07:01 AM:
What version of
nuget.exe
are you using? Does the problem persist with the most recent version?Oskar Berggren on 2/19/2025, 01:38 AM:
After upgrade to VS 17.13.0, getting this exact same problem with nuget.exe 4.19 AND still the same problem with nuget.exe 6.13.1.
Nikolche Kolev [MSFT] on 2/20/2025, 06:13 PM:
Hello,
Can you try using an updated version of NuGet.exe?
5.4.0 is really old and not guaranteed to work with latest MSBuild.
In fact, it is best if NuGet.exe & MSBuild versions are matching as per the release notes.
https://learn.microsoft.com/en-us/nuget/release-notes/nuget-6.13
6.13 of NuGet matches 17.13 of Visual Studio
Why do we ask for more info?
We try to reproduce all issues reported with the information provided in the description and comments. When we can’t reproduce the issue, we ask you for more information so we can resolve the issue as quickly and efficiently as possible.
In our guidelines, you can get tips on how to provide clear and simple reproducible steps.
David Smith on 2/21/2025, 05:09 AM:
Yes, as mentioned above, updating NuGet resolved the issue. I didn’t realize it was checked in as part of the repository and not included with the Visual Studio install.
Thanks.
Original Solutions
David Smith solved on 2/20/2025, 06:29 AM, undefined votes:
We were using 5.6.0.6591. Updating to 6.13.1.3 resolved the issue for us. Now to resolve the new warnings on vulnerable packages that are now reported 😃
The text was updated successfully, but these errors were encountered: