MVC v5.1 was recently GAC'd (see
). When doing File -> New Project for ASP.NET, the project templates set MVC CopyLocal to true. For example (original MVC 5 tooling):
<Reference Include="System.Web.Mvc, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
We used NuGet to update package to v 5.1. At that time, it removed the CopyLocal/Private setting:
<Reference Include="System.Web.Mvc, Version=184.108.40.206, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
(Note that it also added SpecificVersion=false, which seems odd given that NuGet's packages.config is designed to reference specific versions.)
As a result, when MVC 5.1 was GAC'd as part of
, our application stopped deploying correctly to machines without this update installed. (There were also some other problems that occurred because CopyLocal=true was dropped, such as Razor compilation failing on our dev boxes.)
Can NuGet be changed not to drop CopyLocal settings in references? Or, perhaps NuGet should always set CopyLocal/Private=true on all references it adds (and probably do the same for SpecificVersion as well).
Here's an example of this problem affecting our users:
It also affected our project's build. If NuGet had kept CopyLocal, we would have kept working when the Windows Update came out, thanks to the original MVC template settings. But since NuGet removed that setting, we broke when the Windows Update came out.
Note that the precise steps above now behave differently on my machine. Because the assembly is GAC'd, if I install/update now, it sets CopyLocal/Private to true. But if I then upgrade to an assembly that isn't currently GAC'd (such as from MVC v5.1 to MVC
v5.2), it again drops the CopyLocal/Private=true setting. So if MVC 5.2 is ever GAC'd, this problem will occur again.