Forbidden to view WCF svc file?

I am using VS2010 + C # .Net 4.0 + IIS 7.5 + Windows 7. When I open the svc file (in IIS Manager, right click on the svc file and select view) for the WCF project in IIS, there is an error like this, any ideas what is wrong?

This type of page is not served. 
Description: The type of page you have requested is not served because it has been explicitly forbidden.  The extension '.svc' may be incorrect.   Please review the URL below and make sure that it is spelled correctly.

Here is the contents of the web.config file that I am using, is this correct?

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <staticContent>
            <remove fileExtension=".svc" />
        </staticContent>
        <handlers>
            <remove name="svc-ISAPI-2.0" />
            <remove name="svc-Integrated" />
            <add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
        </handlers>
    </system.webServer>
</configuration>
+3
source share
2 answers

You may need to run the command servicemodelreg –iaat the Visual Studio command prompt.

, , ​​ "WCF http" ( " " - " Windows" - Microsoft.Net 3.5.1).

1: , .NET 2.0. IIS " ...". "", , . , .NET 4.0

2: web.config . WCF. (, .NET 4 ) web.config. , .

+2

, mime IIS, aspnet_regiis. mimetype iis .svc, .NET.

+1

Source: https://habr.com/ru/post/1766248/


All Articles