Venkat
Venkat

Reputation: 2579

Nuget Update is not working propelry

I want to update the Nuget packages used in the solution file and currently, I am using the following command to update the Nuget packages.

NuGet restore <projectPath> [options]

Reference: https://learn.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference#restore

If no solution file, packages.config, or project.json is found, NuGet gives an error.

Reference: https://learn.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference#remarks

But the problem is I am using the packages.ProjectName.Config instead of packages.config file.So the NuGet update is not properly working.

Note: Similarly if the folder contains multiple project and solution files the NuGet update is not working.

Please suggest how to overcome this issue?

Edit: Initially I thought the packages.[projectname].config usage in my source is the reason for NuGet packages restoring but later I found that NuGet packages are not even properly restored with packages.config files.

I have more than solution and project file in my source, After deleting the other projects, The NuGet restore is working properly in my source.

Is having more than one solution file is the reason for Nuget not updating? Anyone faced the problems , Any help to overcome this issue will be useful.

Upvotes: 5

Views: 1603

Answers (2)

PaulB
PaulB

Reputation: 982

Looks like you can't specify an arbitrary name but you should be able to accommodate your scenario as of NuGet 2.8. The project names just need to match the filenames - I don't imagine spaces are allowed.

NuGet release notes;

Individual packages.config Files for Different Platforms When developing applications for multiple target platforms, it is common to have different project files for each of the respective build environments. It is also common to consume different NuGet packages in different project files, as packages have varying levels of support for different platforms. NuGet 2.8 provides improved support for this scenario by creating different packages.config files for different platform-specific project files.

ReactiveUI packages.config files

Looks like ReactiveUI do this, so worth checking their repo;

ReactiveUI Github

Upvotes: 1

devlead
devlead

Reputation: 5010

Nuget restore requires a Visual Studio solution file, a packages.config file or a project.json file.

See the remarks for it's beavior.

Upvotes: 5

Related Questions