Reputation: 16695
Following an update of a local NuGet package, it looks like NuGet is not correctly handling the update of the project references. For example, we have updated MyProject.Test to version 1.2; however, the project reference looks like this:
<Reference Include="MyProject.Test, Version=1.0.1.24568, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MyProject.Test.1.2.0\lib\net40\MyProject.Test</HintPath>
<Private>True</Private>
</Reference>
Manually updating the reference seems to correct this (as does manually removing and re-adding the reference), but surely updating the NuGet packages using:
update-package -reinstall
Or simply updating the package in the Manage.. screen should do this for us. Is there something extra that needs to be done to enable this?
Upvotes: 2
Views: 346
Reputation: 76760
Surely updating the NuGet packages need use update-package without -reinstall. The function of command line "update-package -reinstall" is that:
Removing a package and then trying to locate the same package in the NuGet gallery with the same version
If you use this command before update package, NuGet will reinstall the old version package and restore the reference. So you need update your MyProject.Test to version 1.2 using "update-package" before using the "update-package -reinstall" to restore references:
update-package -ProjectName projectname
Alternatively, simply updating the package in the Package Manager UI as you mentioned. Then you need not have do any other extra things to enable this.
Upvotes: 1