Muokkaa

Jaa


Source Link included in the .NET SDK

The Source Link build tooling is now included in the .NET SDK. Source Link enables packages and applications to embed information about the source control information of the built artifacts. As a side effect, commit information is included in the InformationalVersion value of built libraries and applications.

Note

This change affects any project that's built with the .NET 8 SDK, even those that target .NET 7 or an earlier version.

Previous behavior

Prior to this change, the default InformationalVersion of a library or application was the Version property.

New behavior

Starting in .NET 8, the default InformationalVersion of a library or application is the Version property and the SourceRevisionId property.

Version introduced

.NET 8 Preview 4

Type of breaking change

This change can affect source compatibility.

Reason for change

Source Link enables rich editor tooling, like go-to-definition support for non-local source files. This benefit is worth including by default for all artifacts.

If your build process or code doesn't expect Source Revision information in InformationalVersion, you can disable the new behavior by setting the IncludeSourceRevisionInInformationalVersion property to false in your project file.

<PropertyGroup>
  <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
</PropertyGroup>

See also