Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

visual studio error :Unable to start debugging on the web server. The remote server returned an error: (403) Forbidden [duplicate]

I want to run my application from IIS on my local machine. I created the virtual directory and added the application to it.When I run application from IIS it work properly but when I am trying to run through VS 2015 it throws error.

like image 668
Mitali Patil Avatar asked Sep 13 '25 15:09

Mitali Patil


2 Answers

Please run your app using "start without debugging" to get much more information in your side.

I met this kind of error message before which was related to the visit/write access.

Running an ASP.net project with an Application Pool with a specific Identity yields "(403) Forbidden"

like image 76
Jack Zhai-MSFT Avatar answered Sep 16 '25 05:09

Jack Zhai-MSFT


I know this is an old post, however, I have had the same problem within vs2019 after switching to IIS debugging. In my case, I was confident that IIS was set up correctly, as another application was attaching fine.

Eventially after reviewing the documentation, I discovered that your web.config may need altering to include the following attribute:

<configuration>
    <system.web>
        <compilation defaultLanguage="VB"
            debug="true"

After setting debug="true" as stated, the debugger attached fine. Just make sure you're running VS as Admin!

Other things to consider, that I have found along the way:

  • Make sure you are running VS as Admin
  • Ensure your IIS App pool user is correctly set up (correct read/write permissions). Apparently for .Net 4, this also includes read/write to: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files
  • A good old iisreset may also help (start > 'cmd' (as admin) > type: iisreset)
  • Some people have found that setting Load User Profile to false also helps. You can find this in IIS Manager > AppPools > [Your app pool] > Advanced Settings > (category) Process Model. The default will be true
  • The MS document also prompts to check your connection (request) limit (also within Advanced Settings > (category) Recycling

References

  • Microsoft's guide to enabling debugging (where I ultimately found my solution)
  • Microsoft's troubleshooting guide

A few other things to try

  • IIS error, Unable to start debugging on the webserver
  • Unable to start debugging on the web server. The remote server returned an error: (404) Not Found. Error when starting debug in Visual Studio (includes a screengrab of the required Windows Features - still applicable for 2021)
like image 20
Mike C Avatar answered Sep 16 '25 05:09

Mike C