为什么Visual Studio的模块列表中缺少加载的dll? [英] Why is loaded dll missing in Visual Studio's modules list?

查看:364
本文介绍了为什么Visual Studio的模块列表中缺少加载的dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在寻找错误,需要在Visual Studio 2005的发行配置中调试到特定的dll中. 在某个时候,我关闭了解决方案,做了一些其他的事情,然后重新加载了它.从那时起,我的断点没有被击中,并且得到了臭名昭著的未加载任何符号..."消息.因此,我打开了模块窗口,并且要调试的dll不再出现在列表中,因此无法手动加载符号.该应用程序的行为正常,因此我绝对确定该DLL必须已加载才能执行某些功能.果然,如果我重命名dll并启动应用程序,它将不再起作用,因此它也必须是正确的dll.

I am currently bug hunting and need to debug into a specific dll in the release configuration in Visual Studio 2005. At some point I closed the solution, did some other stuff and reloaded it. From that point on my breakpoint doesn't get hit and I get the infamous "No symbols have been loaded..." message. So I opened the modules window and the dll that I want to debug doesn't appear in the list anymore, therefore I cannot load symbols manually. The application behaves normal so I am absolutely sure that the dll MUST have been loaded to execute certain functions. Sure enough, if I rename the dll and start up the application it doesn't work anymore, so it also must be the right dll.

我尝试将dll项目设置为启动项目,并将命令执行到应用程序的exe,然后从Visual Studio外部启动应用程序,然后将其附加到进程,无济于事.

I tried setting the dll project as startup project and the command to execute to the application's exe and starting the application from outside visual studio and then attaching to the process, all to no avail.

问题是,尽管该dll必须已被加载,但为什么它没有出现在已加载的模块列表中呢?我无法想到我所做的任何其他更改,可能会导致此变化,我是否丢失了某些内容? (也许真的很明显吗?)

Question is, why is the dll not appearing in the list of loaded modules although it must have been loaded? I cannot think of any other changes that I've done, that could cause this, am I missing something? (Maybe something really obvious?)

任何帮助表示赞赏!

推荐答案

将项目从一台计算机转移到另一台计算机后,我遇到了类似问题.我将简单说明我发现的内容我如何修复,然后您可以确定它是否适合您的问题和解决方案.

I encountered a similar issue after transferring a project from one computer to another. I will simply explain what I discovered and how I fixed it, and you can determine if it fits your problem and solution.

  1. 我在其上编写了一个应用程序的工作计算机上包含一个我的程序正在引用的.dll文件.将应用程序移到我的家用计算机后,该应用程序无法再找到以前引用的.dll文件,因为该文件不再存在.

  1. The work computer I wrote an application on contained a .dll file which my program was referencing. After moving the application to my home computer, the application could no longer locate the .dll file it was previously referencing because the file was no longer there.

该应用程序即使在没有引用资源(.dll文件)的情况下也可以编译和运行,因为先前编译的程序集(调试文件夹)包含其自己的.dll文件和其他资源的副本.简而言之,它是运行中的旧程序集构建,而不是您正在使用的当前应用程序.这也是为什么此错误趋向于挂起设计器窗口并在应用程序运行完成后引发错误的原因.

The application compiled and ran even without the referenced resource (.dll file) because the previously compiled assembly (debug folder) contained its own copy of the .dll file and other resources. Put simply, it is the old assembly build that is running and not the current application you're working on. This is also why this error tends to suspend the designer window and throw an error after the app is done running.

我将看一下以下内容:

a)在解决方案资源管理器下,进入参考文件夹,并右键单击丢失的参考节点,然后选择属性.在属性框中,观察所引用资源的路径. 资源是否仍位于此路径上?

a) Under Solution Explorer, go into the References folder and right click the missing reference node and select properties. In the properties box, observe the Path of the resource being referenced. Is the resource still located at this path?

b)检查调试文件夹以查找所需资源的副本.如果资源存在,请进行复制,然后将其保存到桌面.如果不存在,请从原始来源获取文件.

b) Check the debug folder for a copy of the resource you're looking for. If the resource is there, make a copy and save it to your desktop. If it's not there, get the file from the original source.

c)在解决方案资源管理器下,右键单击"属性",然后单击"打开".从出现的菜单中,从出现的新窗口的左侧选择"资源",然后在出现的新窗口的顶部,您会看到带有小下拉箭头的"添加资源" . 单击箭头,然后选择"添加现有文件",然后浏览到文件.如果看不到它,则可能必须从打开"和取消"按钮上方的小下拉菜单中更改正在浏览的文件.找到文件后,应在解决方案资源管理器中创建一个名为资源"的新文件夹.现在,该文件是您应用程序的永久部分,而不仅仅是对其的引用.

c) Under Solution Explorer, right click 'Properties' and 'open'. From the menu that appears select 'Resources' from the left and at the top of the new window that appears you you should see 'Add Resource' with a small drop down arrow. Click the arrow and select 'Add existing file' and then browse to the file. If you don't see it you may have to change the file being browsed from the small drop down above the 'open' and 'Cancel' buttons. After the file is located it should create a new folder in the solution explorer called 'resources.' Now the file is a permanent part of your application and not merely a reference to it.

这篇关于为什么Visual Studio的模块列表中缺少加载的dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆