Hello @Akkisetty Srinivasarao (WIPRO LIMITED) ,
Welcome to Microsoft Q&A forum.
Please try to set the <RestoreUseLegacyDependencyResolver>
property to true
in your project file(.xxproj file) and rebuild your project, restore the NuGet packages, see if this works.
If it doesn’t work, try to run this property in Developer Command Prompt for Visual Studio 2022
.
msbuild -t:restore -p:RestoreUseLegacyDependencyResolver="true"
.
I think the issue you got is caused by the changes in 6.12(NuGet), .NET 9 or 17.12(VS), kindly check this document: NuGet Dependency Resolver.
In order to improve the performance and scalability of the restore operation, the restore algorithm was rewritten in the 6.12 release. As of the 6.12 release, the new restore algorithm is enabled by default for all PackageReference projects. While the new restore algorithm is functionally equivalent to the previous one, as with any software, bugs are possible. To revert to the previous implementation, set the MSBuild property
RestoreUseLegacyDependencyResolver
totrue
.
I tested locally by manually installing one of the NuGet packages that shows in the screenshot that you shared, it is still possible to be downloaded and installed. So, if setting the above property doesn’t work, I think you can also try to check the package source and the limitations on your machine.
About the package source, you can open Visual Studio, click Tools, NuGet Package Manager, Package Manager Settings, switch to Package Sources, make sure that the package sources are correctly set and there’s no invalid package source.
About the limitations, please check the antivirus software and the custom(if you created and modified it) nuget.config file.
Kind Regards,
Tianyu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.