Adam
Adam

Reputation: 4184

After adding SSL to local IIS "Unable to start debugging on the Web server"

Visual Studio 2015 (Loaded as Admin), Web API 2, Windows 10.

I have Local IIS with a subdomain sub.mylocalsite.com mapped through the hosts file to 127.0.0.1. The Web API 2 is loading and I am able to debug and do all the activities as expected.

On IIS, if I add a secure binding, with the proper self-signed certificate (without disabling the non-secure binding, i.e. keeping two bindings) and do an IIS Reset, I am able to access the https Web APIs as expected, however, when I click run to start debugging I get the standard error from VS of Unable to Start Debugging.

Please note that I tried both setting the start URL as http://sub.mylocalsite.com and https://sub.mylocalsite.com to no avail

Any solution?

Upvotes: 2

Views: 1409

Answers (1)

user1106591
user1106591

Reputation: 546

I experienced the same thing, then saw this blog post. Try attaching to worker process, per this blog post: https://blogs.msdn.microsoft.com/vijaysk/2007/10/17/visual-studio-debugging-websites-that-require-client-certificates/

The most important requirement for the pretty F5 key to work in Visual Studio is NTLM/Windows Intergated Authentication. Only then can it auto-attach to the IIS worker process. And this is where our trouble starts. Client certificates is a kind of an authentication mechanism. When you configure a website to require client certificates you are changing the authentication mechanism.

So if you are developing a website off an IIS server and you need to debug it with client certificates then you cannot just open your web project in visual studio and start debugging it. But what you can do is attach to the process running your code manually.

Open your project in Visual Studio and set a breakpoint as you usually do

Debug menu > Attach to Process > Select the process running your code.

Upvotes: 2

Related Questions