File/Project/Assembly Version

Best practices, code snippets for common functionality, examples, and guidelines.
Posts: 4
Joined: Tue May 11, 2021 9:56 am

File/Project/Assembly Version

Post by brodrigues » Wed Jul 07, 2021 1:20 pm

Hello everyone.

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

    	<TargetFrameworkProfile />
    	<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    	<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
    	<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>
And by changing the FileVersion parameter when calling msbuild

Code: Select all

msbuild project.sln /p:Configuration=Release /p:FileVersion= 
In both cases, the FileVersion of the test's exe file is, and is instead a different number every time.

Anyone has any thoughts how to do this? Am I doing something wrong?


User avatar
Ranorex Guru
Ranorex Guru
Posts: 7465
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: File/Project/Assembly Version

Post by odklizec » Fri Jul 09, 2021 8:45 am


According to below stackoverflow discussion, using /p:FileVersion alone is not enough. Please follow the instructions from the discussion... ... ng-msbuild
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration