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

PublishRepositoryUrl is not automatically set by .NET SDK 8 #1203

Open
stijnherreman opened this issue Feb 11, 2024 · 1 comment · May be fixed by #1270
Open

PublishRepositoryUrl is not automatically set by .NET SDK 8 #1203

stijnherreman opened this issue Feb 11, 2024 · 1 comment · May be fixed by #1270

Comments

@stijnherreman
Copy link

From the README:

If your project uses .NET SDK 8+ and is hosted by the above providers it does not need to reference any Source Link packages or set any build properties.

Otherwise, you can enable Source Link experience in your project by setting a few properties and adding a PackageReference to a Source Link package specific to the provider:

<Project>
 <PropertyGroup>
    <!-- Optional: Publish the repository URL in the built .nupkg (in the NuSpec <Repository> element) -->
    <PublishRepositoryUrl>true</PublishRepositoryUrl>
 
    <!-- Optional: Embed source files that are not tracked by the source control manager in the PDB -->
    <EmbedUntrackedSources>true</EmbedUntrackedSources>
  </PropertyGroup>
  <ItemGroup>
    <!-- Add PackageReference specific for your source control provider (see below) --> 
  </ItemGroup>
</Project>

Both NuGet Package Explorer and the binlog tell me that EmbedUntrackedSources is set automatically, but PublishRepositoryUrl is not. I do see that GenerateRepositoryUrlAttribute = true is set automatically.

Without explicit PublishRepositoryUrl:
image

With explicit PublishRepositoryUrl:
image

I guess this is simply a documentation error, and not a bug in the SDK?

@mu88
Copy link

mu88 commented Aug 2, 2024

I stumbled over this as well, thx for filing the issue 👍🏻 it's always annoying if the docs state something which is not the case 🤨

mu88 added a commit to mu88/mu88.Shared that referenced this issue Aug 2, 2024
@MattKotsenas MattKotsenas linked a pull request Aug 28, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants