Asp.net HTTP错误404.0-在IIS服务器上找不到wcf路由
我在我的WCF项目中有以下提到的设置,但当我在IIS服务器中部署它时,当我尝试像这样访问我的站点时,会出现404错误: Global.asax:Asp.net HTTP错误404.0-在IIS服务器上找不到wcf路由,asp.net,wcf,iis,.net-4.0,iis-7.5,Asp.net,Wcf,Iis,.net 4.0,Iis 7.5,我在我的WCF项目中有以下提到的设置,但当我在IIS服务器中部署它时,当我尝试像这样访问我的站点时,会出现404错误: Global.asax: public class Global : System.Web.HttpApplication { protected void Application_Start(object sender, EventArgs e) { RouteTable.Routes.Add(new ServiceRoute("MyServ
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
RouteTable.Routes.Add(new ServiceRoute("MyService", new AppServiceHostFactory(), typeof(UserService)));
}
MyService.cs:
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Required)]
public class MyService : IMyService
{
Web.config:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"
aspNetCompatibilityEnabled="true"/>
</system.serviceModel>
AppServiceHostFactory传递给RouteTable.Routes.Add
方法的AppServiceHostFactory
是什么?它是自定义服务主机吗?是的。公共类AppServiceHostFactory:ServiceHostFactory{AppServiceHostFactory是否具有与WebServiceHostFactory相同/相似的功能