WCF ASP.NET routing integration feature requires A

2020-07-23 03:08发布

问题:

I am getting this issue when trying to access my web service from my server.

ASP.NET routing integration feature requires ASP.NET compatibility. Please see 'http://msdn.microsoft.com/en-us/library/ms731336.aspx' on how to do this.

I have added this line to my web.config just like many articles have suggested, yet I still get the same error.

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

What could be the issue?

回答1:

I had the same problem when I had a website with no physical path configured. Configuring a physical path for the website fixed it.

# (PowerShell)
# Give it a physical path.    
mkdir C:\inetpub\wwwroot2
Set-ItemProperty "IIS:\Sites\$WebSiteName" `
    -Name physicalPath -value C:\inetpub\wwwroot2