启动Debugger代码 [英] Start Debugger in Code

查看:141
本文介绍了启动Debugger代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要调试从一键安装开始的应用程序。 (VS 2010,Excel
VSTO与Office 7)。根据提供给一键安装程序应用程序的登录凭据,用户应该看到两个启动页面之一。这在我的机器上都可以正常工作,但是当部署时,从默认值更改为第二个启动页会导致错误。



对于我的生活,我无法弄清楚如何从VS2010中调试进程。我可以在输入凭据之前附加到登录名,但是我无法附加到Excel,因为直到点击确定按钮才启动。那么,有没有办法让Excel,或者我的代码调用调试器,因为它被实例化,所以我可以弄清楚为什么我的图像资源是不可用的在部署的应用程序中?



谢谢。



Randy

解决方案

System.Diagnostics.Debugger.Launch() ;


I need to debug an application that is started from a one-click install. (VS 2010, Excel VSTO with Office 7). Based on login credentials supplied to the one-click installer application, the user should see one of two splash pages. This all works fine on my machine, but when deployed, changing from the default to the second splash page results in an error.

For the life of me, I can't figure out how to debug the process from within VS2010. I can attach to the login before entering the credentials, but I can't attach to Excel because it isn't launched until I click the OK button.

So, is there some way to have Excel, or rather, my code call the debugger as it is instantiated so I can figure out why my image resource isn't available in the deployed application?

Thanks.

Randy

解决方案

System.Diagnostics.Debugger.Launch();

这篇关于启动Debugger代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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