Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between using <DebugType>Full</DebugType> and <DebugType>Portable</DebugType> for .net core projects?

To generate open cover report I have to make debugType as Full. I generate report on build server as I have to fail the build if the coverage doesn't reach a certain threshold. The build is generated in Release mode. What consequence does keeping debugType Full in my csproj file have? Will it degrade the performance in production?

like image 236
Viraj Pangam Avatar asked Oct 24 '17 04:10

Viraj Pangam


2 Answers

The difference is that the "full" type emits a classic windows PDB symbol file which is complex and poorly documented. The "portable" PDB format is a new open-source format that can be created and used on all platforms. You can read more information on this format at it's documentation on the dotnet/core repo.

It has nothing to do with whether or not the application can be debugged, but rather the tools that support the new vs classic format. So there aren't any runtime consequences (except for printing stack traces in .NET Framework < 4.7.1 when you ship portable pdb files with the application and want to see line number mapping).

So until tools are updated to work with the new format, you'll need to change the DebugType property to Full if you need to use tooling which does not yet support the new format which is now the default for "SDK-based" projects.

To only do that for debug builds, you'll want your csproj to contain a section like

<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">   <DebugType>Full</DebugType> </PropertyGroup> 
like image 111
Martin Ullrich Avatar answered Sep 18 '22 17:09

Martin Ullrich


There is no difference between full and pdb-only since Visual Studio 2013 (Roslyn). We should update the docs. @VSadov

https://github.com/dotnet/runtime/issues/25550#issuecomment-374996117

like image 32
dimaaan Avatar answered Sep 20 '22 17:09

dimaaan