Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NrtRevisionFormat no longer works as expected with VS2022 v17.8.3 #27

Open
kiddailey opened this issue Dec 12, 2023 · 5 comments
Open

Comments

@kiddailey
Copy link

kiddailey commented Dec 12, 2023

Just upgraded to VS2022 v17.8.3 and have discovered that my NrtRevisionFormat has stopped working as expected.

For example:

<NrtRevisionFormat>1.0.{revnum} ({chash:5})</NrtRevisionFormat>

The expected result is something like

1.0.1234 (e5a12)

However, I'm now seeing the expected result followed by the full hash. For example:

1.0.1234 (e5a12)+e5a12af0c8f4332982a76c8a4937fb9afdf571d4

More specifically, this is "ProductVersion." The FileVersion property is just the base (1.0.1234) without the hash.

This has worked great for years and nothing else has changed aside from the VS update. For now, I'm manually truncating the value myself, which works but feels broken.

Any thoughts?

@ygoe
Copy link
Owner

ygoe commented Dec 12, 2023

I will have to take a look after upgrading to VS 17.8 myself. I was going to explore .NET 8 a bit but not so soon. At least they already have a few point releases out so the biggest issues should be fixed by now. Maybe the new SDK comes with other variables/properties in MSBuild that need to be used now.

@kiddailey
Copy link
Author

kiddailey commented Dec 15, 2023

Appreciate the reply. No rush -- like I said, I was able to truncate the value as a work-around. I can confirm that it's definitely something with the update. I just upgraded my secondary dev machine and it I got the exact same results.

Edit: I just realized my initial post had the example buggy output wrong. I had part of it duplicated on accident and I've corrected it.

@mattheweshleman
Copy link

Experiencing this since installing .net8 on system, despite building for .net6 at the moment. Happens in Windows or Linux build environments with .net8 installed. I'm using JetBrains Rider, fwiw.

<NrtRevisionFormat>{semvertag}</NrtRevisionFormat>

Previously (and currently on system without .net8 sdk installed) would get the expected version based on the git tag, such as 1.515.1-main.3

Now I get:

1.514.1-main.11+a3d8e158021f0ff1af4d0d3e48a0c3329b4270b9

i.e. the hash is added.

@AndreasAmMueller
Copy link
Contributor

AndreasAmMueller commented Dec 28, 2023

Seems to be new in .NET 8.0 linked to the SourceLink features...

.NET 8.0 - What's new: https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#source-link

Workaround/Fix found here: dotnet/sdk#34568 (comment)

tl;dr:
Add following in a <PropertyGroup/> within your directory.build.props or .csproj file.

<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

You could add this line below here:

<PackageVersion>$(InformationalVersion)</PackageVersion>

@mattheweshleman
Copy link

mattheweshleman commented Jan 1, 2024

Seems to be new in .NET 8.0 linked to the SourceLink features...

.NET 8.0 - What's new: https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-8#source-link

Workaround/Fix found here: dotnet/sdk#34568 (comment)

tl;dr: Add following in a <PropertyGroup/> within your directory.build.props or .csproj file.

<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>

You could add this line below here:

<PackageVersion>$(InformationalVersion)</PackageVersion>

This change:
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
to the app's project settings resolves this issue for me.

Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants