简体   繁体   中英

c# custom installer class .net 4.0 not called

I have c# custom installer class that originally targeted .net 2.0. I have re-targeted it to .net 4.0, and now it does not seen to run. I've proved this by adding Debugger.Break at relevent locations.

Under .net 2.0 the breakpoints are hit. I even tried targeting 3.5 and that worked.

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). The break statement should cause a dialog to prompt to run the debugger. Under .net 2.0/3.5 this happens, but no under .net 4.0

In .Net 4.0 the call to the debugger has been changed, this has thrown me off aswell at some point.

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 :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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