-
Notifications
You must be signed in to change notification settings - Fork 386
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
Add SourceLink to NuGet packages #8464
Conversation
…ild marked with the deterministic flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks similar to what I've had to do to get this working in my own libraries (minus the XAML file bit). Thanks for the clear PR description too.
In one of my libs I also added these. Do you think they'd be useful here?
<Deterministic>true</Deterministic>
<IncludeSource>true</IncludeSource>
Also, do we specify PackageProjectUrl
, PackageLicenseExpression
, RepositoryType
and RepositoryUrl
anywhere?
...VisualStudio.ProjectSystem.Managed.VS/Microsoft.VisualStudio.ProjectSystem.Managed.VS.csproj
Show resolved
Hide resolved
I think |
I'll look into what Package properties are here: project-system/Directory.Build.props Lines 102 to 104 in 7707226
We use |
According to what NuGet Package Explorer was showing, the assemblies were not deterministic until I set |
Yes, NuGet Package Explorer's definition of deterministic includes the deterministic compilation as well as normalized paths to source files in the Pdb. The |
@drewnoakes I'm adding the |
Fixes: #5619
Adds the SourceLink functionality to our NuGet packages. It also makes our build marked with the deterministic flag.
Verification
I used the NuGet Package Explorer to verify the packages. When they started, they looked like this:
I enabled SourceLink but it was still showing issues. Seems I needed the
EmbedUntrackedSources
setting.After adding
EmbedUntrackedSources
, the build was broken. After some investigation, I found an issue that was reported for the problem, but no workaround: dotnet/sourcelink#492I looked into how the generated
.g.cs
files wanted to reference the.xaml
. Then, I determined how to output them to that path. I added those targets to the affected projects. After that, we had SourceLink working.I noticed the Deterministic flag was still red. Found that I needed to add
ContinuousIntegrationBuild
for it to add the/deterministic
compiler flag. After that, everything was green.Microsoft Reviewers: Open in CodeFlow