Kam
Kam

Reputation: 11

Nuget update - Not updating related CSProject File

I have a package "ABC 1.0" and trying to update it to ABC 2.0., The reference is being updated properly on the "packages.config" file., But this is not updating the .csProject file.

....\packages\ABCDAssembly.dll True

Upvotes: 1

Views: 1913

Answers (1)

Leo Liu
Leo Liu

Reputation: 76760

But this is not updating the .csProject file.

It was not that obvious from your question that NuGet not update the .csproj file. And How did you update your project? what is the version of your NuGet? Since there is no detail information, I will provide you what I have know for this question, hope this can give you some help.

  • How did you update your project?

    If you just edit the packages.config file to update the NuGet package from 1.0 to 2.0. It will not cause Visual Studio to make any changes to your project, just restore package. Also NuGet restore does not modify your project. NuGet restore just downloads the NuGet packages and makes them available for your project.

    Instead of editing the packages.config file, I suggest you can use the NuGet Package Manager in Visual Studio, or the Package Management Console, to update the NuGet package in the projects required.

    Or you can run an Update-Package -reinstall to force the NuGet packages to be uninstalled and installed again in the projects. That will fix the assembly references.

  • What is the version of your NuGet? If you are using NuGet 3.2, NuGet will not update the .csproj references. You can refer to the Issue 1483 for detail. So please update NuGet.

If I understand you incorrectly, please share us more detail info, or you can give us some screenshots.

Upvotes: 1

Related Questions