VS 2008 断点目前不会被命中。该文档尚未加载任何符号

发布于 2024-10-19 20:37:10 字数 3040 浏览 5 评论 0原文

我正在努力克服这个障碍,我非常希望有人能提供帮助。

在此处输入图像描述

当我在我的类库项目中设置断点时。它看起来像一个普通的断点。当我开始调试我的解决方案时,断点被掏空并且有一个黄色三角形,里面有一个感叹号。当我平移断点时显示的工具提示是“当前不会命中断点。此文档尚未加载任何符号。

该项目不是 ASP.NET 应用程序,它只是winForms 应用程序。

我已经接管了解决方案中包含多个项目的现有 winForms 应用程序。我已构建项目并在调试模式下运行。我可以在某些项目中的断点处停止,但是,我无法在其他项目中命中断点,特别是我的类库类型的项目。

到目前为止我所做的:

  • 我删除了所有调试和发布文件夹,
  • 删除了 obj 文件夹,然后重建了解决方案。
  • 我已经重新启动了VS2008 IDE。
  • 我已经重新启动了计算机。
  • 我检查了配置管理器中的解决方案,以确保我的类项目包含在调试版本中,而且确实如此。
  • 我已经检查了 dll 的调试/模块,尽管我并没有尝试引用 dll。

此外,我已按照 SO 帖子中概述的故障排除步骤进行操作:

当前不会在未加载符号的情况下命中断点

VS 2010,NUNit,以及“当前不会命中断点。本文档尚未加载任何符号”

当前不会命中断点。本文档尚未加载任何符号。

无法调试 - “当前不会命中断点。本文档尚未加载任何符号”

修复“当前不会命中断点。该文档尚未加载任何符号。”

此外,我还阅读了 Google 来自 MSDN 和其他位置,其中没有一个适合我的特定需求。

其中一些帖子是:

Visual Studio 2008 “该断点将当前尚未加载此文档的任何符号”

当前不会命中断点。本文档尚未加载任何符号

当前不会命中断点。本文档未加载任何符号。

调试器问题“当前不会命中断点。该文档尚未加载任何符号

当前不会命中断点。尚未为此文档加载任何符号。

我读过的所有帖子都提供了非常丰富的信息,但没有一个建议的解决方案适合我的具体需求。如果需要更多信息,请告诉我,我可以提供更多链接,作为我尝试解决此问题的其他步骤

。发布此后续内容是为了让每个人都感到惊讶,我按照 @Hans @ 建议调用有问题的项目文件,

我将一个暗淡的 frm 作为 form = new ProjectInQuestion.FormInQuestion 放置

现在已在调试中加载了程序集。 Windows->模块

新问题比我原来的问题更令人困惑。我的断点看起来不错,但被跳过了。断点处没有明显错误。

在此处输入图像描述

I am struggling to overcome this obstacle and I have high hopes that someone on SO can help.

enter image description here

When I set a breakpoint in my class library project. It appears as a normal breakpoint. When I start debugging my solution the breakpoint becomes hollowed out and has a yellow triangle with an exclamation point inside. The tooltip displayed when I pan over the breakpoint is, "The Breakpoint will not currently be hit. No Symbols have been loaded for this document."

This project is not an ASP.NET application, it is simply a winForms application.

I have taken over an existing winForms application with multiple projects in the solution. I have the project built and running in debug mode. I can stop at breakpoints in some projects but, I am unable to hit the breakpoints in other projects specifically my project that is of type class library.

What I have done thus far:

  • I have deleted all debug and release folders,
  • I have deleted the obj folder, and have rebuilt the solution afterwards.
  • I have restarted the VS2008 IDE.
  • I have restarted my computer.
  • I checked the Configuration Manager for the solution to ensure that my class project is included in the debug build, and it is.
  • I have checked the debug/modules for dll, although I am not trying to reference a dll.

Furthermore, I have followed the troubleshooting steps outlined in the SO posts:

the breakpoint will not currently be hit no symbols loaded

VS 2010, NUNit, and “The breakpoint will not currently be hit. No symbols have been loaded for this document”

The breakpoint will not currently be hit. No symbols have been loaded for this document.

Can't debug - “The breakpoint will not currently be hit. No symbols have been loaded for this document”

Fixing “The breakpoint will not currently be hit. No symbols have been loaded for this document.”

Additionally, I have read numerous posts found on Google from both MSDN and other locations, none of which fit my specific needs.

Some of these posts are:

Visual Studio 2008 "The breakpoint will not be currently hit. No symbols have been loaded for this document"

The breakpoint will not currently be hit. No symbols have been loaded for this document

Breakpoint will not currently be hit. No symbols loaded for this document.

Debugger problem "The breakpoint will not currently be hit. No symbols have been loaded for this document

The Breakpoint will not currently be hit. No Symbols have been loaded for this document.

All of the posts I have read have been very informative, but none of the suggested solutions have fit my specific needs. Please let me know if more information is warranted. I have more links I can provide as references to what has not worked. As well as additional steps I have taken to attempt to solve this issue.

I am posting this follow-up to keep everyone aprised. I followed @Hans @ suggestion to call the project file in question.

I placed a dim frm as form = new ProjectInQuestion.FormInQuestion

and

this now has the assembly loading in the debug--> Windows->Modules

The new problem is more perplexing than my original issue. My breakpoints look fine, but are being skipped. There are no error evident at the breakpoint.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(13

紫﹏色ふ单纯 2024-10-26 20:37:10

这可能是一个老问题,但在找到这个问题的解决方案后我想回答它,因为这是关于这个主题的最完整的问题之一。

简介

我的项目是一个 ASP.NET 应用程序,但基本问题也会发生在 WinForms 上。当程序集输出中缺少 DLL 时,就会出现问题。但是,如果您引用的 DLL 随后又引用了程序集中不存在的另一个 DLL,则会出现同样的异常。由于操作系统加载 DLL 的方式,引用的 DLL 必须位于环境路径中,而不是位于输出程序集中。

项目 A 引用 DLL D。
DLL D 引用 DLL X。
DLL D 可能位于您的输出程序集中。
DLL X 必须位于您的环境路径中。

此问题的核心原因在于操作系统在运行时加载本机 DLL 的方式。使用以下逻辑加载本机 DLL,其中不包括 >临时 ASP.net 文件,也不包括应用程序 /bin 文件夹。如果本机 DLL 未包含在带有 .EXE 文件的 /bin 文件夹中,或者 DLL 不在路径环境变量中,则任何 .Net 应用程序也会出现此问题。

个人解决方案

我使用了一个名为 DivaAPIWrapper.dll(C# 的托管 DLL)的 DLL。然而,我知道 DivaAPIWrapper.dll 需要 DivaAPI.dll(非托管 C++)才能运行。我将 DivaAPI.dll 放置在所有输出路径中,但我不断收到此错误。只有在我将 DivaAPI.dll 放入我的环境路径 (C:\windows\Microsoft.Net\Framework\v2.0.50727) 后,它才起作用。 请注意:如果您使用较新版本的 .NET 框架,您的路径可能会有所不同!

Jerry Orman 提供的完整解决方案

请参阅此处的链接 (@web.archive. org):

http://blogs.msdn.com/b/jorman/archive/2007/08/31/loading-c-assemblies-in-asp-net.aspx

This may be an old question, but I wanted to answer it after I found a solution for this very problem because it was one of the most complete questions asked in regards to this topic.

Intro

My project is an ASP.NET application, but the base problem will happen on WinForms as well. The problem arises when a DLL is missing from the assemblies output. However, this same exception occurs if the DLL you are referencing then references another DLL that is not in the assemblies. Due to the way the operating system loads DLLs, the referenced DLL must be in the environment path, and not in your output assemblies.

Project A references DLL D.
DLL D references DLL X.
DLL D may be in your output assemblies.
DLL X must be in your environment path.

The core cause to this problem is in the way the operating system loads native DLL's at >runtime. Native DLL's are loaded using the following logic which does not include the >Temporary ASP.net Files nor the applications /bin folder. This problem will also occur in >any .Net application if the Native DLL is not included in the /bin folder with the .EXE >file or if the DLL is not in the Path Environment Variable.

Personal Solution

I was using a DLL called DivaAPIWrapper.dll (Managed DLL for C#). I knew, however, that DivaAPIWrapper.dll needed DivaAPI.dll (Unmanaged C++) to operate. I placed DivaAPI.dll in all my output paths but I kept receiving this error. Only after I placed DivaAPI.dll in my environment path (C:\windows\Microsoft.Net\Framework\v2.0.50727) did it work. Please note: your path may be different if you're using a newer version of the .NET framework!

Complete Solution by Jerry Orman

See Link Here (@web.archive.org):

http://blogs.msdn.com/b/jorman/archive/2007/08/31/loading-c-assemblies-in-asp-net.aspx

落在眉间の轻吻 2024-10-26 20:37:10

我也遇到了同样的问题,并从互联网上找到了许多解决方案,但下面列出了适合我的解决方案:

这是由于我的应用程序是在框架版本 4.0 中制作的,并且我试图附加版本低于 v2.0 的进程,因此请确保您的框架版本为托管代码版本如下所示。

在此处输入图像描述

I also faced same problem and found many solution from internet but solution works for me is listed below:

Its due to my application made in framework version 4.0 and i was trying to attach process with version below v2.0 so make sure your framework version with Managed code version as its shown below.

enter image description here

玩套路吗 2024-10-26 20:37:10

我最近在附加到正在运行的进程时发生了这种情况。问题是调试选项设置为

附加到:本机代码

对于我的情况,它需要是:

附加到:托管代码

This happened to me recently when attaching to a running process. The issue was that the debugging options were set to

Attach to: Native code

For my case, it needed to be:

Attach to: Managed code

另类 2024-10-26 20:37:10

我最近发现了一件事并且效果非常好!

托管应用程序(调用要使用的 dll 的应用程序)必须具有这一行:

<supportedRuntime version="v4.0"/>

在“WhateverApplicationItIs.exe.config”文件中的 部分内。

示例:(请参阅“...”作为文件中包含的任何内容,并保持原样)

<configuration>
    ...
    <supportedRuntime version="v2.0.50727"/>
</configuration">

PS:尝试将此版本与项目属性中设置的目标框架相匹配。我相信 2.0.50727 对于 3.5 Framework 来说是一个很好的尝试,对于 4.0 Framework 来说 4.0 是一个很好的尝试。

对我来说,它只是解决了我试图在不同应用程序中调试的两个不同的 DLL。

One thing I discovered recently and worked pretty nice!!!

The hosting application (the one that is calling your dll to be used) must have this line:

<supportedRuntime version="v4.0"/>

in the "WhateverApplicationItIs.exe.config" file, inside the <configuration> section.

Example: (See "..." as whatever the file has inside it and leave as is)

<configuration>
    ...
    <supportedRuntime version="v2.0.50727"/>
</configuration">

PS: try to match this version with the target framework set in your project properties. I believe 2.0.50727 is a good try for 3.5 Framework, and 4.0 for 4.0 Framework.

For me it just solved two different DLLs I was trying to debug in different applications.

清君侧 2024-10-26 20:37:10

我经常遇到这种情况,就像你说的,在加载 DLL 之前断点不会激活。但这实际上并不重要,因为无论如何它都必须先加载 DLL,然后代码才能到达该点。我的断点以这种方式开始,但它们总是会被击中。

I have this happen all the time, like you said the breakpoint is not active until the DLL is loaded. It really doesn't matter though, because it has to load the DLL before the code can get to that point anyway. My breakpoints start this way but they always get hit.

一张白纸 2024-10-26 20:37:10

检查您是否没有更改要编译该项目的处理器。我做到了,当我把它改回来时,一切又恢复了。显然,处理器的变化使其“与原来的不同”

Check that you didn't change the processor at which you aimed to compile this project. I had, and when I changed it back, everything worked again. Apparently a change in processor makes it 'different than the original'

眉目亦如画i 2024-10-26 20:37:10

我在 Vb.net-forms 应用程序中使用 VS2008 时遇到了同样的问题,我在另一个项目中调用了 dll,加载到同一个项目组中。我找到了这个简单的解决方案:我在 form_load 事件中加载了一个实例,例如
调暗 pmg 作为新 PMGExport.PMGExportNeu。

I had the same Problem with VS2008 in a Vb.net-forms application where I called a dll in another project, loaded in the same project group. I found this simple solution: I loaded an instance in the form_load event like
Dim pmg As New PMGExport.PMGExportNeu.

空‖城人不在 2024-10-26 20:37:10

请检查工具栏上的解决方案配置器模式(运行按钮旁边)是否设置为“调试”而不是“发布”

Please check if Solutions Configurator mode on the toolbar (right next to Run button) is set to "Debug" rather than "Release"

佞臣 2024-10-26 20:37:10

希望这有帮助...

即使我处于调试模式,我仍然引用了 bin\Release 文件夹中的 DLL。

我将 DLL 复制到 bin\Debug 文件夹,当我运行 VS 时,断点被命中。

Hope this helps...

I was referencing a DLL that was in my bin\Release folder, even though i was in debug mode.

I copied the DLL to bin\Debug folder and when i ran VS, the breakpoint was hit.

过期情话 2024-10-26 20:37:10

试试这个,
在Vs 2008中,转到“工具”->“选项”->“调试”->“常规”->“调试”。未选中/禁用'要求源文件与原始版本完全匹配

try this,
In Vs 2008,Go to Tools->option->Debugging->General-> unchecked/disable 'Requires source files to exactly match the original version

病女 2024-10-26 20:37:10

我在vs2010上有同样的问题,我按照流程步骤解决了:

  1. 右键单击项目
  2. 选择属性
  3. 选择c/c++ - >常规
  4. 将调试信息格式设置为程序数据库(/ZI)
  5. 检查链接器- >调试生成调试信息是。

I have the same problem on vs2010, I resolved in flow steps:

  1. Right-click project
  2. Select the properties
  3. Select c/c++ ->General
  4. Set debug information format to program Database(/ZI)
  5. Check linker->debugging Generate Debug info is yes.
与他有关 2024-10-26 20:37:10

请检查工具栏上的解决方案配置器模式(运行按钮旁边)是否设置为“调试”而不是“发布”
为我工作,谢谢

Please check if Solutions Configurator mode on the toolbar (right next to Run button) is set to "Debug" rather than "Release"
Worked for me thx

孤檠 2024-10-26 20:37:10

在开始调试之前,请确保在 Visual Studio 中选择调试模式

检查 Visual Studio 中 播放 按钮附近的下拉列表。

Make sure debug mode is selected in Visual Studio, before you start debugging.

Check the dropdown, near to the Play button in Visual Studio.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文