简体   繁体   English

c#自定义安装程序类.net 4.0未调用

[英]c# custom installer class .net 4.0 not called

I have c# custom installer class that originally targeted .net 2.0. 我有最初针对.net 2.0的c#自定义安装程序类。 I have re-targeted it to .net 4.0, and now it does not seen to run. 我已将其重新定位到.net 4.0,但现在看来它没有运行。 I've proved this by adding Debugger.Break at relevent locations. 我已经通过在相关事件位置添加Debugger.Break证明了这一点。

Under .net 2.0 the breakpoints are hit. 在.net 2.0下,会遇到断点。 I even tried targeting 3.5 and that worked. 我什至尝试以3.5为目标,而且效果很好。

I realise there a similar questions relating to this but the answers seem to suggest "wrong framework" or "use something else" variety. 我意识到存在与此相关的类似问题,但答案似乎暗示着“错误的框架”或“使用其他东西”的多样性。

Thanks! 谢谢!

Edit - 编辑-

I have an installer class 我有一个安装程序课程

public partial class ScriptRunner : Installer
{...

public override void Install(System.Collections.IDictionary stateSaver)
{
   System.Diagnostics.Debugger.Break();
   ...

This is tested by running the installer (ie setup.exe). 通过运行安装程序(即setup.exe)进行测试。 The break statement should cause a dialog to prompt to run the debugger. break语句应导致对话框提示运行调试器。 Under .net 2.0/3.5 this happens, but no under .net 4.0 在.net 2.0 / 3.5下会发生这种情况,但在.net 4.0下不会发生

In .Net 4.0 the call to the debugger has been changed, this has thrown me off aswell at some point. 在.Net 4.0中,对调试器的调用已更改,这在某些时候也使我不满意。

Changing 改变中

System.Diagnostics.Debugger.Break();

Into 进入

System.Diagnostics.Debugger.Launch();

Made it work for us, not sure if that also worked for 2.0 and 3.5 since we switched to 4.0 and stuck with it :) 使它对我们有用,不确定是否也适用于2.0和3.5,因为我们切换到4.0并坚持使用它:)

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

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