Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Document NuGet.exe's MSBuild requirements #14125

Open
vsfeedback opened this issue Feb 21, 2025 · 1 comment
Open

Document NuGet.exe's MSBuild requirements #14125

vsfeedback opened this issue Feb 21, 2025 · 1 comment
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

Comments

@vsfeedback
Copy link

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 😃

@microsoft-github-policy-service microsoft-github-policy-service bot added Transferred issue This issue is transferred from VSFeedback or other github repo Triage:Untriaged labels Feb 21, 2025
@nkolev92 nkolev92 changed the title NuGet update fails loading Microsoft.VisualStudio.SolutionPersistence from a command line build with MSBuild 17.13 Document NuGet.exe's MSBuild requirements Feb 21, 2025
@nkolev92
Copy link
Member

Potentially, we should add warnings when issues are seen and a super old version of msbuild is used.
https://learn.microsoft.com/en-us/nuget/release-notes/nuget-5.9

Another idea is to potentially add a warning in NuGet.exe when all projects being restore are PackageReference.

@nkolev92 nkolev92 added Product:NuGet.exe NuGet.exe Type:Docs Priority:2 Issues for the current backlog. and removed Triage:Untriaged labels Feb 21, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants