简体   繁体   English

如何调试VS2010安装项目?

[英]How to debug VS2010 setup project?

How to debug VS2010 setup project? 如何调试VS2010安装项目? I tried attaching to msiexec.exe , but it didn't help. 我尝试附加到msiexec.exe,但它没有帮助。

I am assuming you want to debug a custom action in the installer. 我假设您要在安装程序中调试自定义操作。 If so having the solution open while running the installer and have this line of code in one of the events. 如果是这样,在运行安装程序时打开解决方案并在其中一个事件中使用此行代码。

System.Diagnostics.Debugger.Launch(); System.Diagnostics.Debugger.Launch();

When prompted say yes to debug the installer and select the instance of Visual Studio with your project already loaded. 当系统提示时调用安装程序并选择已加载项目的Visual Studio实例。

It appears that I need to halt my managed code so the process will appear in the debug window. 看来我需要暂停托管代码,以便进程显示在调试窗口中。 It can be done by calling MessageBox.Show. 它可以通过调用MessageBox.Show来完成。 After that the msiexec managed code entry appears in the processes and if I attach to it I will be able to debug my custom actions code. 之后,msiexec托管代码条目出现在进程中,如果我附加到它,我将能够调试我的自定义操作代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM