Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the NuGet Package Manager removing SpecificVersion False from the project file

When I update a NuGet package whose reference I've set to be

<SpecificVersion>False</SpecificVersion>

it removes this line from the project (csproj) file.

What is the rationale behind this behavior and is there a way to control or work-around this?

like image 311
Dejan Avatar asked Sep 11 '15 16:09

Dejan


1 Answers

This is how NuGet is currently implemented. There is no workaround that I am aware of. You would probably have to write a PowerShell script to fix up the references that are changed on updating.

Upgrading the NuGet package will uninstall the old version and install the new version which causes the reference to be removed and then added again. The new reference has the default values for a new reference so the old values are not remembered.

In MonoDevelop and Xamarin Studio support was explicitly added for maintaining the Local Copy value of a reference but not the Specific Version property.

like image 104
Matt Ward Avatar answered Sep 29 '22 19:09

Matt Ward