When does Visual Studio kill an .exe launched via "Start Without Debugging"? - visual-studio-2017

I'm building ASP.NET web apps in VS 2017. Start Without Debugging runs the application, however I can't tell when VS decides to kill the exe. How is that managed? I'm not encountering a problem; all behavior is per documentation. Just curious.

Related

Running a Visual C++ 6 Console Application as a Windows Service

Is it possible for a Win32 Console Application to be used as a Windows service?
Normally this wouldn't be an issue using C#, .NET, and Visual Studio 2010 or higher, but this is a legacy application that was written in C++ using the Visual C++ 6 environment.
Mainly for the ability to restart itself after a crash.
Is it possible for a Win32 Console Application to be used as a Windows service?
Yes. In fact, many services are written as console apps. Even MSDN examples are.
The app's main() simply needs to call StartServiceCtrlDispatcher() to establish a link to the Service Control Manager:
Writing a Service Program's main Function
Mainly for the ability to restart itself after a crash.
The correct way to handle that is to just let it crash. Use ChangeServiceConfig2() to configure the service's SERVICE_CONFIG_FAILURE_ACTIONS info. One of the available actions is SC_ACTION_RESTART.

Application hangs when debugged with Application Verifier

I added my C++ application to Application Verifier. I am able to run it by directly executing the exe. But if I run it from VS 2013 or WinDbg, it just hangs with 0 CPU usage.
Even if I directly execute the exe, at a certain point it uses all my memory (10GB), and I have to restart the computer. So now I do not have a way to use Application Verifier to debug it.
There is only one line log created when my application starts. I do not see any other logs in Application Verifier.
Does anyone know what is wrong with my case?
If I disable the TLS option in Application Verifier, it will work in a debugger.

Debugging multiple executions of a same project in ms visual studio

I need to run the Visual C++ (2012 pro) remote debugger for multiple processes of a windows driver application.
In the solution property page there’s an option to select multiple startup projects. Is there any similar option to run the remote debugger on multiple executions of a same project?

Visual studio debugger not working

I am using Microsoft Visual Studio debugger to debug a remote application. These are the steps I have done
I have taken the x86 version of the msvsmon.exe in the remote machine (which has 32 bit OS) where the application to be debuggedis running. I have started the exe with the options No authentication and Allow any user to debug.
In Visual studio I set Debug option as Win32, go to Tools and Attach the process. I give the IP, choose the transport type as remote and try to start the debugger. However, I am getting the following error message --
Unable to connect to ‘MyMachine’. The Microsoft Visual studio Remote debugging monitor is either not running on the remote machine or is running in windows authentication mode.
I have checked the firewall settings. Please help if you have any idea as to what could be the issue.
If you are debugging native code then run the remote debugger in no-authentication mode. MSDN has notes here. Note that you have to connect to the remote debugger quickly (within 30 seconds) in this mode, otherwise it times-out.
Did you specify "Native debugging" in Attach to process dialog?

Automating DLL Debugging "attach to process" in Visual Studio?

I'm writing an SNMP extension agent DLL for Windows.
Is there a way to automatically attach the DLL to the SNMP service each time I want to test/debug?
This is a very tedious and time consuming process, as I currently have to stop the SNMP service, compile, restart the service and then attach the process. I'm trying to automate it more.
This may be what you want to have a look at.
Visual Studio debugger offers some command line option to attach to running process. You can probably write a Python script to enumerate running processes and attach the debugger to the service. I think you need admin priviledge to do that.
.Net has a convinient Debugger.Launch(), but I can't find an equivalent for the native.