简体   繁体   English

VS代码“无法找到或打开PDB文件”,即使pdb存在并且加载了其他csproj pdb文件

[英]VS Code “Cannot find or open the PDB file” even though the pdb exists and it loads other csproj pdb files

I'm launching a web api project and I noticed the problem when I tried to set a breakpoint in the logic layer (which is a separate csproj) and it showed unverified breakpoint. 我正在启动一个Web api项目,当我尝试在逻辑层(这是一个单独的csproj)中设置一个断点时,我注意到了这个问题,它显示了未经验证的断点。

Digging into it I found that the Debug console shows "Cannot find or open the PDB file" even though the pdb file exists in the directory it searches AND it can load the other 7 csproj dll's that are in the same directory. 深入研究它,我发现调试控制台显示“无法找到或打开PDB文件”,即使它搜索的目录中存在pdb文件,并且它可以加载同一目录中的其他7个csproj dll。

I've tried cleaning and rebuilding, deleting the repo and recloning, restarting my computer, etc. Not sure how to proceed or what other information to provide. 我尝试清理和重建,删除存储库并重新克隆,重新启动计算机等。不确定如何继续或提供其他信息。 Please help because this will keep me from using vs code. 请帮忙,因为这会使我无法使用vs代码。

Try Tools-> Options-> Debugging-> Symbols. 尝试使用“工具”->“选项”->“调试”->“符号”。 Select checkbox "Microsoft Symbol Servers". 选择复选框“ Microsoft Symbol Servers”。 Visual Studio will download PDBs automatically. Visual Studio将自动下载PDB。 Let me know if it does not work. 让我知道它是否无效。

Setting debug type to portable in the csproj file worked. 在csproj文件中将调试类型设置为Portable即可。

 <PropertyGroup>
   <DebugType>portable</DebugType>
 </PropertyGroup>

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

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