404 when running .net 4 WCF service on IIS (no svc file)

后端 未结 4 1040
孤街浪徒
孤街浪徒 2020-12-08 08:13

I\'m testing out a REST service in WCF on .net 4 - i.e. no svc file. It works great when running against the VS dev server but when I switch it to run against IIS I get 40

4条回答
  •  一整个雨季
    2020-12-08 08:54

    I had runAllManagedModulesForAllRequests="true" in my web.config but still couldn't get past the 404.0. Also tried installing "IIS 7 Recommended Configuration" without any luck. Rerunning aspnet_regiis solved the problem to me.

    1. In the Run dialog box, type cmd, and then click OK.

    2. At the command prompt, use the cd command to change the directory of the Aspnet_regiis.exe version you want to use. By default, Aspnet_regiis.exe is located in the following directory: systemroot\Microsoft.NET\Framework\versionNumber

    3. Then run the following command: aspnet_regiis -ir

    This will register "svc-Integrated-4.0" in the Handler Mappings.

提交回复
热议问题