In my current C++ project I am using visual studio 2019. The output binary sat target.exe is used as a service and is created using sc.exe create
command.
When we run this service it crashes immediately. So I need to debug this service. I was trying to use attach process but the service is getting crashed immediately. For a workaround I modify the code and add a 1 minute sleep in code. So now service is crashing after 1 minute and mean while I am able to attach the process. Now when service crashes, the vs output window only displaying
The program '[17396] target.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.
How can I debug this service and get the back-trace. I have found one debug setting Just My code and already disabled it but has no effect. Also enabled settings to break for all exceptions.