Asp.net mvc 3 404访问MVC 3、IIS 7上的WCF数据服务器时出错
我知道,对于这个问题有很多搜索结果,但没有任何帮助 WCF数据服务在开发环境中,在临时服务器上,而不是在live box上,运行得很好。 我已经试过了Asp.net mvc 3 404访问MVC 3、IIS 7上的WCF数据服务器时出错,asp.net-mvc-3,iis-7,wcf-data-services,Asp.net Mvc 3,Iis 7,Wcf Data Services,我知道,对于这个问题有很多搜索结果,但没有任何帮助 WCF数据服务在开发环境中,在临时服务器上,而不是在live box上,运行得很好。 我已经试过了 routes.IgnoreRoute("API4/HUB.svc"); routes.IgnoreRoute("API4/HUB.svc/{*pathInfo}"); 但这只是将错误从MVC404更改为IIS404 有趣的是,我已经有一些WCF服务正在运行,但这是第一个WCF数据服务 正如我所说,我已经尝试了谷歌建议的一切,如果有任何提示,我将
routes.IgnoreRoute("API4/HUB.svc");
routes.IgnoreRoute("API4/HUB.svc/{*pathInfo}");
但这只是将错误从MVC404更改为IIS404
有趣的是,我已经有一些WCF服务正在运行,但这是第一个WCF数据服务
正如我所说,我已经尝试了谷歌建议的一切,如果有任何提示,我将不胜感激
以下是整个web.config(删除了一些敏感数据):
我发现了问题。这是服务器上的Plesk。它认为删除所有标准HTTP处理程序并用专有的Plesk处理程序替换它们是一个好主意,因为Plesk处理程序无法处理WCF数据服务。潜在的.net版本问题?生产服务器上是否安装了.net 4.5?我以前在mvc应用程序中运行过一个wcf服务,它使用忽略路由“routes.IgnoreRoute(“{resource}.svc/{*pathInfo}”);”应用程序池配置为使用错误的.net版本?只需仔细检查:.net 4.5已安装,应用程序使用的是4.0应用程序池。应该可以。您是否尝试从暂存服务器导出IIS设置,并尝试将其与生产环境中的设置进行比较?甚至可能将它们导入到生产中以创建所需的站点/虚拟目录?通配符映射妨碍了吗。svc设置是否与其他扩展一起工作*如果你是对的,IIS设置是唯一剩下的变量。我将分析直播和登台之间的区别,看看有什么突出。找到了(见下文)。谢谢你的帮助!
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<!--<section name="uri" type="System.Configuration.UriSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>-->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="MomentumHub.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="webpages:Version" value="1.0.0.0" />
<add key="ClientValidationEnabled" value="true" />
<add key="UnobtrusiveJavaScriptEnabled" value="true" />
</appSettings>
<connectionStrings>
<add name="HUBAPIdb" connectionString="metadata=res://*/API4.HUBAPIdb.csdl|res://*/API4.HUBAPIdb.ssdl|res://*/API4.HUBAPIdb.msl;provider=System.Data.SqlClient;provider connection string="data source=.\;initial catalog=HUB;user id=...;password=...;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
</assemblies>
</compilation>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login" timeout="2880" />
</authentication>
<membership defaultProvider="HUBMembershipProvider">
<providers>
<clear/>
<add name="HUBMembershipProvider" type="MomentumHub.Models.HUBMembershipProvider, MomentumHub" />
</providers>
</membership>
<roleManager defaultProvider="HUBRoleProvider" enabled="true" cacheRolesInCookie="true">
<providers>
<clear/>
<add name="HUBRoleProvider" type="MomentumHub.Models.HUBRoleProvider, MomentumHub" />
</providers>
</roleManager>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages" />
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<basicHttpBinding>
<binding name="TextAnywhere_SMSSoap" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
<binding name="ServiceSoap" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://ws.textanywhere.net/ta_sms.asmx" binding="basicHttpBinding"
bindingConfiguration="TextAnywhere_SMSSoap" contract="TextAnywhere_SMS.TextAnywhere_SMSSoap"
name="TextAnywhere_SMSSoap" />
<endpoint address="http://www.textapp.net/webservice/service.asmx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="TextAnywhere_SMS_v2.ServiceSoap" name="ServiceSoap" />
</client>
</system.serviceModel>
<!--<uri>
-->
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
which is necessary for OpenID urls with unicode characters in the domain/host name.
It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
<!--
<idn enabled="All"/>
<iriParsing enabled="true"/>
</uri>-->
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
<parameters>
<parameter value="data source=.\;initial catalog=HUB;user id=...;password=...;multipleactiveresultsets=True" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
</applicationSettings>
</configuration>