Closed ctaggart closed 6 years ago
The work-a-round was published as SourceLink.Copy.PdbFiles
in February. Simply add it to your project for the work-a-round.
I know this is closed, but SourceLink.Copy.PdbFiles
does not work anymore with SDK 2.1.300. New workaround is required see below.
<Target Name="_ResolveCopyLocalNuGetPackagePdbs" Condition="$(CopyLocalLockFileAssemblies) == true" AfterTargets="ResolveReferences">
<ItemGroup>
<ReferenceCopyLocalPaths Include="@(ReferenceCopyLocalPaths->'%(RootDir)%(Directory)%(Filename).pdb')" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' and Exists('%(RootDir)%(Directory)%(Filename).pdb')" />
</ItemGroup>
</Target>
Thanks @kukjevov. Happy to take a pull request.
Fixed by @kukjevov in #352. SourceLink.Copy.PdbFiles has the update in 2.8.3:
<Project>
<ItemGroup>
<PackageReference Include="SourceLink.Copy.PdbFiles" Version="2.8.3" PrivateAssets="All" />
</ItemGroup>
</Project>
The bug is here https://github.com/dotnet/sdk/issues/1458. This should be added to the Known Issues in the readme. It prevents source linking from working for apps targeting .NET Framework when using the net .NET Core project system.
I logged more info here:
There is a workaround by @jnm2 which involves adding this to your project file: