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

一个人想着一个人 提交于 2019-12-19 05:06:23

问题


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?


回答1:


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>


来源:https://stackoverflow.com/questions/46902377/what-is-the-difference-between-using-debugtypefull-debugtype-and-debugtype

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!