Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2022 v17.8 appends string to DLL product version and AssemblyInformationalVersionAttribute

Recently I upgraded to Visual Studio version 17.8, and now some of my unit tests are failing.

In the test project, I'm setting the assembly version with property <Version>1.0.0</Version>, but in the compiled DLL, the version becomes 1.0.0+67a555...; which seems to be a hash or a GUID.

enter image description here

This never happened with previous Visual Studio versions.

Because some tests rely on the version string being 1.0.0, this behavior breaks them.

Is there any way to disable the compiler (?) from appending to the version string?

PS The test project in this example targets .NET Framework 4.8 and .NET 6.0 (<TargetFrameworks>net48;net6.0</TargetFrameworks>); in both cases, the +67a555... string is appended.

like image 750
Steven Volckaert Avatar asked Oct 12 '25 16:10

Steven Volckaert


1 Answers

Set this property in the project file to get rid of this messed up behaviour:

<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

Source

like image 185
Thomas Mitsogiannis Avatar answered Oct 14 '25 06:10

Thomas Mitsogiannis



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!