Home > OS >  Debugging Installed Released Windows Form application which is not opening
Debugging Installed Released Windows Form application which is not opening

Time:10-11

I created a windows form application using c# language that uses multiple DLLs. Alongside it has an exe file that should run in background as a service, everything is ok in debugging and release mode but when I created a setup file I checked every step of creating setup file. It makes a perfect setup and it's installing fine and also uninstall, but when I click on the icon of my program or exe file in its directory it does not open or do anything!

How can I debug that and find out what's going wrong?

FYI: I'm using visual studio 2022

CodePudding user response:

try calling Debugger.Launch() from System.Diagnostics as early as possible in your code. This will make it so a window pops up, where you can attach a debugger / visual studio.

It basically halts your application until either a debugger is chosen or the window is cancelled. If you choose to attach a debugger, you will land at a breakpoint at the call of Debugger.Launch().

  • Related