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

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?

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.

Related

Another Visual Studio 2015 Debugging Azure Web Site

I have searched all over the web, read and tried every solution I could find and none of them have solved my issue.
I have a web site on Azure. It is an App Service.
I am developing with the latest patched Visual Studio 2015.
I am able to right click in server explorer on my web app and attach to debugger.
None of the break points activate. They all have the error that symbols have not been loaded.
I made sure to build the site in debug.
I verified that the PDB files are on the server (using service explorer and looking at actual files).
I verified that the PDB files match what I have by date and time.
I tried to manually attach the debugger using the menu.
I put in mysite.azurewebsites.net:4020 as the server and am asked to log in. I use my credentials and they don't work.
I tried created a username and password on the azure portal credentials page for FTP. I tried using those and it still won't let me log in.
I am able to deploy using Web Deploy in the publish wizard.
I have no idea how to fix this. I must be able to debug my site.
I have 2 slots and tried debugging either of those and that doesn't work.
I tried debugging the main (production slot) and get the same results.
Help???

msdeploy.axd returns 404

I'm trying to setup webdeploy on IIS8, but why am I getting 404 when accessing both https://[servername]:8172/msdeploy.axd and https://localhost:8172/msdeploy.axd locally.
I've installed management service.
I've installed webdeploy 3.5 using web platform installer. In Program and Features a changed the instalation of webdeploy to include all features including the handler.
In IIS Manager I've chosen Configure Web Deploy Publishing for default website's context menu.
I've restarted management service.
when i tried https://[servername]:8172/msdeploy.axd I was asked to enter credentials and accept the certificate. after that I got 404.
I've uninstalled webdeploy and installed using MSI manually including all features.
restarted entire server.
getting 404.
I don't believe you can open the service from a browser. I attempted that against a dev server that we deploy to many times a day and also received a 404. I would try deploying from VS instead as a test.
Also if anyone comes here and is using Visual Studio Publish dialog and the "Validate Connection" button fails: do NOT use the button when creating. Just click Ok, then Edit (in More actions menu).
In the Connection tab, click Validate Connection. This time it will asks you to accept an invalid certificate (since you likely self-signed it on your server). Accept it and the connection should go through.

IIS and Visual Studio is having different result

http://localhost:72/Home/Support?_subject=&_category=&_reportedDateFrom=09%2F05%2F2013&_reportedDateTo=09%2F05%2F2013&_solvedDateFrom=&_solvedDateTo=&_status=
Above is the pre-setup IIS website .. the date filtering is not filtering correctly.
http://localhost:54550/Home/Support?_subject=&_category=&_reportedDateFrom=09%2F05%2F2013&_reportedDateTo=09%2F05%2F2013&_solvedDateFrom=&_solvedDateTo=&_status=
Above is the visual studio debug URL, just the port number is different and it's working perfectly.
I have no idea what is happening.
To debug this I would start with the following:
Do a clean and rebuild of your solution.
Make sure you don't have two copies of the application running.
Make sure the application is being hosted in IIS properly. (Does the app show up when you right click and browse the web site from the IIS manager)
Attach the debugger to the process running under IIS in order to inspect the query parameters.
This article is getting a bit old but it has the general procedure you need to follow to attach to IIS to inspect a process.

Applying SSL certificate in IIS manager and "The process cannot access the file because it's being used by another process" error

I applied a self-signed SSL certificate in IIS manager to Default Web Site(added the HTTPS binding) and after that when I'm trying to start the web site, I'm getting the following error message:
"The process cannot access the file because it's being used by another process. (Exception from HRESULT: 0x80070020) ". But when I remove the HTTPS binding, everything works fine.
So, what is the problem? What might have I done wrong?"
Have you tried the Microsoft Support Article that mentions this process error occuring when you try to start a Web site in the Internet Information Services MMC snap-in
If you're trying to do this on a local machine, Skype can block the https port (443). To stop this:
Skype - Tools > Options > Advanced > Connection, then uncheck 'Use port 80 and 443 as alternatives for incoming connections'. Then quite Skype (right click in task bar, 'Quit Skype'), and try starting the website again in IIS.
VmWare Workstation 8 grabs 443 for its VM Sharing feature. You can disable it in the settings. http://communities.vmware.com/thread/341114
Yes exiting the Skype desktop app fixed this for me also.
If your running Windows 8(.1) the Skype App (Windows Store App) doesn't use the local 443 port if you can live without installing the desktop Skype app. Also you can pin it to your taskbar. This solution is good enough for me since I don't need all of the features the desktop version offers.
You may want to use some sysinternals tools to see if the file is really used by another process. I recommend Process Explorer. Once you've located the culprit, you can usually see why it opens the file.
If you can't find any process, maybe your code tries to open the file; check for any file handlers you may not have closed.

Unable to start debugging on the web server. The underlying connection was closed. The connection was closed unexpectedly

All of the sudden I'm getting the following error on my local web server (Win7 64bit, IIS 7.5). I've uninstalled & reinstalled IIS locally and it didn't fix it. IIS is set to start up automatically and I can see that the service has been successfully started. Upon a fresh reboot if I go into IIS and click on start website I get the following error:
The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020
If I try to start debugging on my local website project I get the following error:
Unable to start debugging on the web server. The underlying connection was closed. The connection was closed unexpectedly.
Any ideas on what I can try? I've been doing research on the issue and Microsoft suggest making sure no other service is listening on the same ports. I've verified that this isn't the issue.
Try changing the web site to use a port other than 80 (suggest 8080 for example) and see it if will start. If so that's a sure sign of another service using port 80 (Skype is a common culprit for this).
Application pool's identity password changed?
I know this is an old post, but I can't believe how many times I've been bitten by this. Some shops use integrated security for SQL, and often then on your local IIS needs your network login for the application pool. When your password expires, and you forget to change your password here, start banging your head on the wall... DOH!
Open IIS. Select Application Pools. Select the application pool used by your app. Click Advanced Settings... Select Identity, and the little "..." button to update your user/password.

Resources