Repository navigation
Description
Description
The Source Link build tooling is included in the .NET SDK as of .NET SDK 8.0.100-preview.4, which enables packages and applications to embed information about the source control information of the built artifacts. As a side effect, by default commit information will be included in the InformationalVersion of build libraries and applications.
Version
.NET 8 Preview 6
Previous behavior
Prior to this change, the default InformationalVersion of a library or application would be the Version property.
New behavior
After this change, the default InformationalVersion of a library or application would be the Version property as well as the SourceRevisionId property.
Type of breaking change
- Binary incompatible: Existing binaries may encounter a breaking change in behavior, such as failure to load or execute, and if so, require recompilation.
- Source incompatible: When recompiled using the new SDK or component or to target the new runtime, existing source code may require source changes to compile successfully.
- Behavioral change: Existing binaries may behave differently at run time.
Reason for change
Source Link enables very rich editor tooling, like go-to-definition support for non-local source files. We think this benefit is worth including by default for all artifacts.
Recommended action
If your build process or code is not expecting Source Revision information in the InformationalVersion, you can disable this behavior by setting the IncludeSourceRevisionInInformationalVersion property to false.
Feature area
SDK
Affected APIs
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
- StatusShow more project fields✅ Done
Activity
rainersigwald commentedon Oct 23, 2023
@baronfel isn't this "source incompatible" rather than "behavior change"? Existing binaries don't change behavior but updating the SDK and rebuilding can change a version string.
4 remaining items
Update SDK version and modify BuildLifetime.cs
Update Target Framework Moniker to net8.0
Update Target Framework Moniker to net8.0
Update Target Framework Moniker to net8.0
Update Target Framework Moniker to net8.0
Update Target Framework Moniker to net8.0
DalekBaldwin commentedon Dec 18, 2023
It would help to also document the
SuppressImplicitGitSourceLinkproperty. As it is now, in a repo with no mention of SourceLink, after you execute git commands that should leave up-to-dateness unchanged, net8.0 considers all projects to be marked for rebuilding.adurmus commentedon Dec 20, 2023
Imagine your CI/CD relies on Product Version. Suddenly whole CI/CD operations fail because the
ProductVersioncannot be parsed anymore withSystem.Version. Well done.Vermis0 commentedon Jan 18, 2024
This also affects calls to these methods (possibly others) since they are using the ProductVersion as part of the path ("Base Path\CompanyName\ProductName\ProductVersion"):
System.Windows.Forms.Application.UserAppDataPath
System.Windows.Forms.Application.LocalUserAppDataPath
System.Windows.Forms.Application.UserAppDataRegistry
Having the data paths change after every commit instead of when the version was changed was unexpected behavior and disruptive during active development. I don't imagine a typical developer will expect to "lose" their user data on next application launch/debug just by committing a code change.