Support for "classic" .NET project
See original GitHub issueWe are running an on-premises devops server which creates nuget packages from our modules. All projects are “classic” .NET projects (targeting 4.7.2). In order to enable source link support we added the following packages to our modules:
<package id="Microsoft.Build.Tasks.Git" version="1.0.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.SourceLink.AzureDevOpsServer.Git" version="1.0.0" targetFramework="net472" developmentDependency="true" />
<package id="Microsoft.SourceLink.Common" version="1.0.0" targetFramework="net472" developmentDependency="true" />
Furthermore the project files (*.csproj) were modified like this:
<PropertyGroup>
...............
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<SourceLinkAzureDevOpsServerGitHost Include="XXX" VirtualDirectory="/" />
</ItemGroup>
In another repository we have projects with references to these NuGet packages. When running in a debugger the symbols are loaded but the sources are not found. So we are a little bit lost here. For me it is not really clear what steps have to be done in order to use SourceLink support in “classic” .NET projects. By the way the debug information (pdb) will be put to a network share during the builds.
Issue Analytics
- State:
- Created 4 years ago
- Comments:18 (5 by maintainers)
Top Results From Across the Web
Port from .NET Framework to .NET 7 - .NET Core
Understand the porting process and discover tools you may find helpful when porting a .NET Framework project to .NET 7.
Read more >Classical ASP - Microsoft Q&A
Hi @Suraj Kiran, Is your project ASP or ASP.Net? Classic ASP is no longer supported. You can open Classic ASP with VS, but...
Read more >c# - How do I reference a .NET Framework project in ...
The trick is to make sure that you are supporting the same .NET ... NET projects by right clicking the project and opening...
Read more >Upgrading an existing .NET project files to the lean new ...
In Visual Studio 2017 and .NET Core 2 (and beyond) the csproj format is MUCH MUCH leaner. There's a lot of smart defaults,...
Read more >The absolutely horrendous things you need to do to migrate to ...
I have a very large code base with Service Fabric projects referencing ASP. ... NET Classic with a modified Identity Layer, so that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks @MTantos1, i expected that SourceLink drops the need for pdb files but from your explanation it is clear that it “just” changes file paths and has a file provider per repo type. Would be nice if the core part of your explanation on how SouceLink works would be part of the official docs and prevent misconceptions caused by the marketing team. The quote i posted above mentions nothing about pdb.
@bjuraga: What source link does is allow you to view the source, via a repository, when debugging. Without the symbol files (PDBs) it would be impossible for the debugger to link to anything other than machine code (or MISL). The metadata, as you call it, is stored in the symbol file, so without it SourceLink has no chance of doing anything.
When you build a project the compiler outputs a symbol file, which is basically a map from the executable (likely a dll) to the corresponding source. The problem with this is that the symbol file will refer to the source file location on the build machine, which may not be the same machine you are trying to debug from. So when you try and debug the debugger will try and find the source file at a location that likely doesn’t exist, or find a modified version of the source.
What SourceLink does, is effectively re-write the symbol file, so that the symbol file no longer maps to a path on the build machine, but to a repository url. So, with the proper tooling, when you attach the debugger, rather than looking for files on your local machine it looks for the source on GitHub, etc.