使用 <DebugType>Full</DebugType> 和使用有什么区别?和 <DebugType>Portable</DebugType>.net 核心项目? [英] What is the difference between using <DebugType>Full</DebugType> and <DebugType>Portable</DebugType> for .net core projects?

查看:21
本文介绍了使用 <DebugType>Full</DebugType> 和使用有什么区别?和 <DebugType>Portable</DebugType>.net 核心项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要生成开放式封面报告,我必须将 debugType 设为 Full.我在构建服务器上生成报告,因为如果覆盖率没有达到某个阈值,我必须使构建失败.构建是在发布模式下生成的.在我的 csproj 文件中保留 debugType Full 有什么后果?它会降低生产中的性能吗?

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?

推荐答案

不同之处在于完整"类型发出一个经典的 Windows PDB 符号文件,该文件复杂且文档不足.便携式" PDB 格式是一种新的开源格式,可以在所有平台上创建和使用.您可以在 有关 dotnet/的文档中阅读有关此格式的更多信息核心存储库.

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.

这与应用程序是否可以调试无关,而与支持新格式与经典格式的工具有关.因此,没有任何运行时后果(除了在 .NET Framework < 4.7.1 中打印堆栈跟踪之外,当您随应用程序一起提供可移植的 pdb 文件并希望查看行号映射时).

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).

因此,在工具更新为使用新格式之前,如果您需要使用尚未使用的工具,则需要将 DebugType 属性更改为 Full支持新格式,该格式现在是基于 SDK"的项目的默认格式.

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.

要仅对调试版本执行此操作,您需要在 csproj 中包含类似

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>

这篇关于使用 &lt;DebugType&gt;Full&lt;/DebugType&gt; 和使用有什么区别?和 &lt;DebugType&gt;Portable&lt;/DebugType&gt;.net 核心项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆