Skip to content

[Breaking change]: Source Link is included in the .NET SDK #37674

Description

@baronfel

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


Associated WorkItem - 177280

Activity

  1. rainersigwald commented on Oct 23, 2023

    @rainersigwald
    Member

    @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.

  2. added
    source incompatibleSource code may encounter a breaking change in behavior when targeting the new version.
    on Oct 31, 2023
  3. added
    📌 seQUESTeredIdentifies that an issue has been imported into Quest.
    and removed
    🗺️ reQUESTTriggers an issue to be imported into Quest.
    on Nov 1, 2023
  4. 4 remaining items

  5. ghost added
    in-prThis issue will be closed (fixed) by an active pull request.
    on Nov 8, 2023
  6. moved this from 🔖 Ready to 👀 In review in dotnet/docs November 2023 sprinton Nov 8, 2023
  7. moved this from 🆕 New to ✅ Done in .NET 8.0 work itemson Nov 8, 2023
  8. ghost removed
    in-prThis issue will be closed (fixed) by an active pull request.
    on Nov 8, 2023
  9. DalekBaldwin commented on Dec 18, 2023

    @DalekBaldwin

    It would help to also document the SuppressImplicitGitSourceLink property. 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.

  10. adurmus commented on Dec 20, 2023

    @adurmus

    Imagine your CI/CD relies on Product Version. Suddenly whole CI/CD operations fail because the ProductVersion cannot be parsed anymore with System.Version. Well done.

  11. Vermis0 commented on Jan 18, 2024

    @Vermis0

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

🏁 Release: .NET 8Work items for the .NET 8 release📌 seQUESTeredIdentifies that an issue has been imported into Quest.breaking-changeIndicates a .NET Core breaking changesource incompatibleSource code may encounter a breaking change in behavior when targeting the new version.

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions