调试DLL项目在Visual Studio 2008中使用附加到进程 [英] Debugging DLL Project in Visual Studio 2008 Using Attach to Process

查看:804
本文介绍了调试DLL项目在Visual Studio 2008中使用附加到进程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发使用C#.NET 2.0和Visual Studio 2008 Professional的DLL。我想调试(即设置一个断点),它使用附加到进程并将其连接到应用程序的可执行文件。我觉得这是工作;至少,我没有收到任何错误消息。但是,我尝试设置任何断点得到与他们一点警告消息指出,禁用断点目前不会被击中,没有符号已经加载了这个文件。我如何可以得到断点调试工作任何想法将不胜感激。不幸的是,我不能简单地运行,因为它的安装过程的复杂性,从VS应用;我需要的DLL以某种方式连接到安装可执行文件(我可以切换出该文件,如果需要的话)和调试断点。谢谢你。

I am developing a DLL using C# .NET 2.0 and Visual Studio 2008 Professional. I would like to debug (i.e. set a breakpoint in) it using Attach to Process and attaching it to the application's executable. I think this is working; at least, I'm not getting any error messages. However, any breakpoints that I try to set get disabled with a little warning message on them stating, "The breakpoint will not currently be hit. No symbols have been loaded for this document." Any thoughts on how I can get debugging with breakpoints working would be much appreciated. Unfortunately, I cannot simply run the application from VS because of the complex nature of its install process; I need to somehow attach the DLL to the installed executable (I can switch the file out, if need be) and debug with breakpoints. Thanks.

推荐答案

请确保你有你试图连接到代码的调试版本。如果这是一个发布版本没有pdb文件,你会得到您所描述的错误。另外,还要确保你有在连接到选择器选择的正确的类型。选择器应设置为自动或管

Make sure you have a debug version of the code you're trying to attach to. If it's a release version with no pdb files you will get the error you're describing. Also make sure you have have the correct type selected in the "Attach to" selector. The selector should be set to Automatic or Managed.

享受!

这篇关于调试DLL项目在Visual Studio 2008中使用附加到进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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