0
votes

To enable upgrade, I did modify the AssebmlyVersion of DLL and didn't change AssemblyFileVersion. I assumed as I changed AssemblyVersion, the installer automatically detects the latest DLL and replace at the time of upgrade. But, upgrade failed to install the latest DLL.

In VS2015 project when I changed the AssemblyVersion, I didn't see the ProductVersion reflecting that. Later when I changed, AssemblyFileVersion then I noticed the ProudctVersion of assembly reflecting the version. Any idea why this behavior?

2

2 Answers

1
votes

It seems like adding AssemblyInformationalVersion explicitely in AssemblyInfo.cs would influence the Assembly>Property>Details>Product Version

[assembly: AssemblyInformationalVersion("1.1.1.1")]

NOTE: This attribute is not available by default.

Also, I learnt that AssemblyFileVersion is used for deployment related work by installers and hence in my case it is used as ProductVersion of assembly and AssemblyVersion is not used as Assembly>Property>Details>Product Version.

0
votes

An upgrade in a Visual Studio project uses the RemovePreviousVersion project value set True. Also, increment the setup project's ProductVersion and accept the changes (ProductCode will change). At this point the upgrade is ready as far as the MSI is concerned. Still relevant:

https://www.red-gate.com/simple-talk/dotnet/visual-studio/updates-to-setup-projects/

To actually get updated files to be replaced their file versions need to be incremented, basically because of the overwrite rules:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa367835(v=vs.85).aspx

For Win32 files this is the file version, for managed code it's AssemblyFileVersion. It's usually better to change just AssemblyFileVersion because AssemblyVersion is used for linking to client assemblies, which is often something you don't want to change.