I have a solution with Asp.NET Core project, and a WiX Project that generates an MSI to deploy it to an IIS Server.
Currently whenever we build the project we have to update build numbers in the following locations:
- Asp.NET Project Properties Page > Package Tab > Package version: x.x.x
- Asp.NET Project Properties Page > Package Tab > Assembly version: x.x.x.x
- Asp.NET Project Properties Page > Package Tab > Assembly file version: x.x.x.x
- WiX wxs file:
I want to minimize the number of individual edits required to update the version. Ideally I'd only like to have to set versions on Asp.NET Project Properties Page, and Wix automatically reflect the change.
Based on related answers I was able to get the WiX version to get set automatically by binding it to the AssemblyFileVersion. However there are two issues with that solution. You end up with 4 digit version number for MSI, and god knows what will end up choking on that in the future. Another issue is that I don't want to tie my MSI version to dll version (there may be a case where the package is updated by dll is not).
That's why I'm looking for a way to automatically set WiX version to the package version from Asp.NET properties page. It solves the two issues above, as that version number can be set to 3 digits, and it is also not tied to dll file versions. How do I go about it? The package version is stored inside Asp.NET csproj file as following (it's the 1.0.2 tag):
<PropertyGroup>
...
<Version>1.0.2</Version>
<AssemblyVersion>1.0.0.2</AssemblyVersion>
<FileVersion>1.0.0.2</FileVersion>
<Company>My Company</Company>
<Product>My Product</Product>
<Authors>My Company</Authors>
</PropertyGroup>
How can I set attribute inside wxs project file to that value during build? I'll even go with hack solutions at this point, because it doesn't look like there's a standard way of doing it.