.Net 8 Product Version

.NET8 — ProductVersion contains git commit hash (en)

With the release of .NET 8, significant changes have been made regarding version-related properties in builds. Specifically, the update has affected the Source Link tooling, which is now included in the .NET SDK. This tool allows packages and applications to embed information about the version control system from which the build artifacts were created. As a result, commit information is now automatically included in the InformationalVersion property of libraries and applications.

What You Need to Know

This change applies to all projects built with the .NET 8 SDK, including those targeting .NET 7 or earlier versions.

Reason for the Change

The Source Link tooling provides richer development features, such as go-to-definition support for external source files. This functionality is considered valuable enough to be included by default in all build artifacts.

Recommendations

If your build process or code does not expect source revision information in the InformationalVersion property, you can disable the new behavior by setting the IncludeSourceRevisionInInformationalVersion property to false in your project file:

<PropertyGroup>
  <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>Code language: HTML, XML (xml)

Sources:

Добавить комментарий