I want to set the .exe file's FileVersion to a fixed specific number. I want to do this to try to have deterministic builds with Ranorex.
I tried doing this by altering the .csproj file like so...
Code: Select all
<PropertyGroup>
<FileVersion>1.2.3.4</FileVersion>
<Deterministic>true</Deterministic>
<ProjectGuid>{69F58903-94CB-49F3-B983-478724830446}</ProjectGuid>
<TargetFrameworkProfile />
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<OutputType>Exe</OutputType>
<RootNamespace>VIP_vdev_SanityTests</RootNamespace>
<AssemblyName>VIP-vdev-SanityTests</AssemblyName>
<NoWarn>1591</NoWarn>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<RANOREX_BIN_PATH Condition=" '$(RANOREX_BIN_PATH)' == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Ranorex\Studio', 'InstallDir', null, RegistryView.Registry64, RegistryView.Registry32))\Bin</RANOREX_BIN_PATH>
<RanorexTargetsPath>$(RANOREX_BIN_PATH)\Ranorex.MSBuild.Targets</RanorexTargetsPath>
<projectdefaultrepository>9df31964-10e3-4c32-b808-cd48c1d170bd</projectdefaultrepository>
<StartAction>Project</StartAction>
</PropertyGroup>
Code: Select all
msbuild project.sln /p:Configuration=Release /p:FileVersion=1.2.3.4
Anyone has any thoughts how to do this? Am I doing something wrong?
Thanks.