固定"断点将目前尚未受到打击。无符号已加载这个文件&QUOT。断点、符号、加载、目前

2023-09-02 11:29:34 作者:灵魂狗友i

在EX preSS版C#桌面应用程序。奋力再没有正常工作5秒后。

C# desktop application on express edition. Worked then didn't work 5 seconds later.

我尝试以下。

确保调试配置,调试标志,以及完整的调试信息的所有程序集的设置。 删除所有bin并从我的整个机器与项目有关的OBJ文件夹和所有的DLL文件。 重新创建项目从无到有造成问题的原因。 重新启动。

我在解决方案二的WinForms项目。其中一个加载调试信息,一个没有。他们都指我试图让调试信息在正好在项目文件的方式组装。任何想法?

I have two WinForms projects in the solution. One of them loads the debug info, one doesn't. They both refer to the assembly I'm trying to get debug info on in exactly the same way in the project file. Any ideas?

我要添加在这里,主要是为我自己,当我回过头来审查这个问题,未加载符号,直到组件加载,该组件没有加载,直到需要它。如果断点在一个库,只用在一个函数在你的主组件,这些符号不会被加载(它会显示断点不会被打),直到该函数被调用。

I want to add in here, mostly for myself when I come back to review this question, that symbols are not loaded until the assembly is loaded, and the assembly is not loaded until it is needed. If the breakpoint is in a library that is only used in one function in your main assembly, the symbols will not be loaded (and it will show the breakpoint as not being hit) until that function is called.

推荐答案

只要你已经到达一个断点,或使用调试和GT开始调试;打破一切,使用调试和GT; Windows和GT;模块。你会看到所有被加载到进程的组件列表。找到你想要得到的调试信息的人。用鼠标右键单击它并选择符号负载信息。你会得到一个对话框,列出了所有的地方找了组装.pdb文件的目录。验证与实际.PDB位置列表。请确保它没有找到一个旧的。

Start debugging, as soon as you've arrived at a breakpoint or used Debug > Break All, use Debug > Windows > Modules. You'll see a list of all the assemblies that are loaded into the process. Locate the one you want to get debug info for. Right-click it and select Symbol Load Information. You'll get a dialog that lists all the directories where it looked for the .pdb file for the assembly. Verify that list against the actual .pdb location. Make sure it doesn't find an old one.

在正常的项目,大会及其.pdb文件应始终被复制的IDE到同一文件夹作为.exe文件。您项目的bin Debug文件夹。确保你从GAC删除一个,如果你一直在玩它。

In normal projects, the assembly and its .pdb file should always have been copied by the IDE into the same folder as your .exe. The binDebug folder of your project. Make sure you remove one from the GAC if you've been playing with it.