vb.net 当前不会命中 VS 2008 断点。尚未为该文档加载任何符号

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5181401/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 15:19:20  来源:igfitidea点击:

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

vb.netvisual-studio-2008breakpoints

提问by Michael Eakins

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

我正在努力克服这个障碍,我非常希望 SO 上的某个人可以提供帮助。

enter image description here

在此处输入图片说明

When I set a breakpoint in my class libraryproject. 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 pointinside. 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.

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

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.

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

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

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

此外,我遵循了 SO 帖子中概述的故障排除步骤:

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”

VS 2010、NUUnit 和“当前不会命中断点。尚未为该文档加载任何符号”

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 Googlefrom both MSDNand other locations, none of which fit my specific needs.

此外,我从MSDN和其他位置阅读了在Google 上找到的许多帖子,但没有一个适合我的特定需求。

Some of these posts are:

其中一些帖子是:

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

Visual Studio 2008“当前不会命中断点。没有为此文档加载符号”

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.

我发布此后续行动以让每个人都感到震惊。我按照@Hans @ 建议调用了有问题的项目文件。

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

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

and

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

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

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

在此处输入图片说明

采纳答案by Magnum

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.

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

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.

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

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.

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

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!

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

Complete Solution by Jerry Orman

Jerry Orman 的完整解决方案

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

请参阅此处的链接:http: //blogs.msdn.com/b/jorman/archive/2007/08/31/loading-c-assemblies-in-asp-net.aspx

回答by Bhaumik Patel

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.

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

enter image description here

在此处输入图片说明

回答by Kim

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

附加到:托管代码

回答by Daniel

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:

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

<supportedRuntime version="v4.0"/>

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

在“WhateverApplicationItIs.exe.config”文件的<configuration>部分内。

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.

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

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

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

回答by Kratz

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.

我一直在发生这种情况,就像您说的那样,在加载 DLL 之前断点是不活动的。不过这真的无关紧要,因为无论如何它都必须在代码到达该点之前加载 DLL。我的断点以这种方式开始,但它们总是被击中。

回答by hanamant

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

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

回答by yangchao

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

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

  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.
  1. 右键单击项目
  2. 选择属性
  3. 选择 c/c++ -> 常规
  4. 将调试信息格式设置为 program Database(/ZI)
  5. 检查链接器->调试生成调试信息是是。

回答by paulie the poster

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'

检查您没有更改编译此项目的目标处理器。我有,当我把它改回来时,一切又恢复了。显然,处理器的变化使其“与原始版本不同”

回答by Wohlstand

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.

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

回答by Cenk

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

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