I am desperately trying to achieve the supposedly very simple goal of debugging an MVC 6 (Core 1.1) web app in VS 2017 RC3. Normal debugging does not work, as VS always times out trying to attach to the program, as asked about in my VS 2017 always times out debugging an MVC Core website on IIS Express profile question. Now I am stuck with "Start without debugging", and trying to attach to whatever process is actually hosting my app.
The app type is a Console Application, which starts up the Kestrel host, yet this console app produces no .exe
that I can find anywhere. Of course I have tried to attach to IIS Express, but using that, none of my breakpoints are ever hit. I believe in these scenarios, IIS EXpress merely acts as a proxy to the actual console app that is my MVC app, so maybe I should attach to the actual web app process, but what in hell's name is that process?
You need to attach to the dotnet.exe process. You may have multiple dotnet.exe (especially if you run a .NET Core project VS at the same time). Typically, when you press Ctrl+Shift+P in VS it would be the first dotnet.exe.
However, your symptoms look like your application is not actually starting at all and IIS Express cannot find the process. I would start from checking event log for IIS Express related events as IIS logs the process ID of the application it started and the failures if any.
A better way to debug this might be to skip IIS Express at all and start your application directly from command line with dotnet run
. This way you will see output in the command line window. You can also print the process id from your Main method with:
Console.WriteLine("Process ID: " + System.Diagnostics.Process.GetCurrentProcess().Id);
so that it easy to figure out what process to attach to if you need it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With