0
votes

I have an application written in Visual Studio 2013, and I'm using a Setup and Deployment Project to distribute it. All of the bullet points in Akash Kava's answer to this question are set:

Installing a new version of a deployment project over old version

i.e "DetectNewerInstall" is set to true, "RemovePreviousVersion" is set to true, etc. I'm also changing the ProductCode and allowing Visual Studio to create a new GUID, but the UpgradeCode is the same. I am also incrementing the version numbers of the C# projects that are added to the Setup Project as Primary Output.

So when a user runs the setup on a machine that already has my software installed, it performs an upgrade. When this happens, all of the content that I wrote upgrades just fine. However, there are some NuGet references (SignalR, Owin, Netwonsoft, etc.) that do not upgrade. Even though the packages were updated in the project and manifest, the installer won't replace the old versions of the NuGet .dlls with the new ones. When I do a new install and examine the .dlls in the Program Files, I can see that the NuGet .dlls are the new version, so I know that the correct versions are being bundled with the Setup Project properly. It just appears that they are not being overwritten if they already exist. And this only happens with the NuGet references; the .dlls and .exes that I wrote upgrade properly.

Is there any way to force the Setup Project to always replace the NuGet .dlls?

1

1 Answers

0
votes

However, there are some NuGet references (SignalR, Owin, Netwonsoft, etc.) that do not upgrade. Even though the packages were updated in the project and manifest, the installer won't replace the old versions of the NuGet .dlls

NuGet has nothing to do with deployment and it is supposed to download packages only when you build your project OR you download from console.

Setup/Installer should automatically detect the dependencies based on PrimaryOutput but if some of dlls are not referenced in project and are required for deployment then you should add them to installer project manually.

On creating new installer make sure to build all projects so that installer project can update the dlls to new version if you have changed it in application project therefore no action required to deploy new version of assemblies considering you have already configured installer to remove previous version on installing new version.