0
votes

First of all, this error started happening about two weeks ago and I honestly don't think I have changed any configuration.

I have an ASP.NET application that targets framework 4.7.2. It was working fine until two weeks ago. But now when I use the "Local IIS" debug function and then stop debugging, two things happen:

  1. When trying to run debug again, I get the following error:

Unable to start debugging on the web server. The remote server returned an error: (403) Forbidden.

  1. Before and during the first debug round, I can access the website via a browser. But after I stop debugging, I get 404-Not found when trying to access the site via its url. Detailed information includes: "Handler: StaticFile".

I can access the site as soon as I exit Visual Studio. And I can debug fine when I reopen the Visual Studio IDE.

Note1: I am using Visual Studio 2017 Version 15.9.15

Note2: IIS reset does not help. Only restarting Visual Studio helps.

1

1 Answers

0
votes

From MSDN:

There are many possible causes for this error, so check your log file and the IIS security settings for the web site.

Make sure the server's web.config includes debug=true in the compilation element.

Make sure that your Web Application folder has the right permissions and that your Application Pool configuration is correct (a password may have changed). See Check your IIS Configuration.

If these settings are already correct and you are debugging locally, also verify that you are connecting to the correct server type and URL (in Properties > Web > Servers or Properties > Debug, depending on your project type).