navarq
navarq

Reputation: 1345

Unable to start debugging on the web server. Operation not supported. Unknown error 0x800040005

enter image description here

Getting this on Windows 10 Pro, Visual Studio 2017. ASP .NET Framework 4.6

Upvotes: 8

Views: 7435

Answers (4)

sthames42
sthames42

Reputation: 1009

This answer was first described here.

This is most likely a problem with URL Rewrite rules redirecting the DEBUG request Visual Studio sends to the Project Url:

Request URL: https://Project.Url:443/debugattach.aspx
HTTP_METHOD: DEBUG

In our case, all .aspx requests were being redirected to index.aspx so we added this:

<rule name="DebugBypass" stopProcessing="true">
  <match url="^.*$"/>
  <conditions>
    <add input="{HTTP_METHOD}" pattern="^DEBUG$" />
  </conditions>
  <action type="None"/>
</rule>

Worked like a charm.

FYI - Discovered this by turning on Failed Request Tracing for the Project URL and evaluating the trace log.

Upvotes: 1

TheEmirOfGroofunkistan
TheEmirOfGroofunkistan

Reputation: 5654

Another thing to check for, in our case our live config had the DEBUG verb denied:

<security>
  <requestFiltering removeServerHeader="true">
    <verbs>
      <!--disable DEBUG verb-->
      <add verb="DEBUG" allowed="false" />
    </verbs>
  </requestFiltering>
</security>

Upvotes: 0

WhiteleyJ
WhiteleyJ

Reputation: 1691

I had this issue and found that removing a https rewrite rule to force www fixed it for me.

Upvotes: 14

navarq
navarq

Reputation: 1345

Using the task manager to close all Visual Studio processes currently running and restarting visual studio fixed the issue.

Upvotes: 1

Related Questions