不太确定是什么引起了问题,我删除了bin文件夹,然后运行了一个构建,现在看来它可以运行了。System.Diagnostics.Debugger.Launch()
确实可以正常工作,它必须包含在#if DEBUG
@SteinÅsmul所说的内容中。内置DEBUG后,运行输出的.msi,当您在安装过程中点击自定义操作时,系统将提示您打开Visual Studio实例。
[CustomAction]
public static ActionResult CustomAction(Session session)
{
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif
Message@R_491_2419@.Show("Hello World!" + session[IISSessions.AppPoolName], "External Managed CA");
return ActionResult.Success;
}