简体   繁体   English

Visual Studio 不会将 .pdb 文件复制到 Appx 文件夹中

[英]Visual studio doesn't copy the .pdb file into Appx folder

I was debugging a UWP app.我正在调试一个 UWP 应用程序。 I found that the exception stack trace doesn't contain the line numbers.我发现异常堆栈跟踪不包含行号。 After a lot of tests, I found that the.pdb file doesn't be copied to the Appx folder.经过大量测试,我发现.pdb文件没有复制到Appx文件夹中。 Maybe, it's the root issue.也许,这是根本问题。 How to deal with this issue?如何处理这个问题?

Microsoft Visual Studio Professional 2017 Version 15.9.4 Microsoft Visual Studio 专业版 2017 版本 15.9.4

Just handle your issue that how to add pdb files into appx folder.只需处理您的问题,即如何将 pdb 文件添加到 appx 文件夹中。

There are two ways:有两种方法:

1) MSBuild by default removes all the pdb files during the generation of the appx. 1) MSBuild 默认会在 appx 生成过程中删除所有pdb文件。 You can add this xml node under app.csproj file to enable that.您可以在 app.csproj 文件下添加此 xml 节点以启用它。

<PropertyGroup>
        <AppxPackageIncludePrivateSymbols>true</AppxPackageIncludePrivateSymbols>
</PropertyGroup>

2) You could embed the pdb file into the exe file so that the debugging info will act with the exe without worrying about losing a separate pdb file. 2)您可以将 pdb 文件嵌入到 exe 文件中,以便调试信息将与 exe 一起起作用,而不必担心丢失单独的 pdb 文件。

Right-click on the Project Properties --> Build --> Advanced -->change Debug Information to Embedded .右键单击Project Properties --> Build --> Advanced --> 将Debug Information更改为Embedded

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM