部署的WCF Silverlight应用程序返回404错误

时间:2015-06-02 23:26:51

标签: c# asp.net wcf silverlight iis

我有一个我在IIS 8中托管的Silverlight 5 Web应用程序。我可以在VS 2013中运行我的应用程序,但在部署到运行IIS 8的Windows 2012服务器上,我的应用程序无法运行。提琴手给我以下内容:  说明:HTTP 404.您要查找的资源(或其中一个依赖项)可能已被删除,名称已更改或暂时不可用。请查看以下网址,确保拼写正确。

我的Web.config文件如下所示:



<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <sectionGroup name="system.serviceModel">
      <section name="domainServices" type="System.ServiceModel.DomainServices.Hosting.DomainServicesSection, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" allowDefinition="MachineToApplication" requirePermission="false" />
    </sectionGroup>
  </configSections>
  <appSettings>
    <add key="ApplicationName" value="......" />
  </appSettings>
  
  <system.web>
    <httpModules>
      <add name="DomainServiceModule" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    </httpModules>
    <httpRuntime targetFramework="4.5" maxRequestLength="10000000" executionTimeout="120" />
    <compilation debug="true" targetFramework="4.5">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
      </assemblies>
    </compilation>
    <roleManager enabled="true" />
    <authentication mode="Forms">
      <forms name=".ABCD_ASPXAUTH" timeout="20" />
    </authentication>
    <profile>
      <properties>
        <add name="FriendlyName" />
      </properties>
    </profile>
    <pages controlRenderingCompatibilityVersion="4.0" />
    
    <customErrors mode="RemoteOnly" defaultRedirect="DefaultRedirectErrorPage.aspx">
      <error statusCode="403" redirect="AccessDenied.htm" />
      <error statusCode="404" redirect="Http404ErrorPage.aspx" />
    </customErrors>
    
  </system.web>
  <system.web.extensions>
    <scripting>
      <webServices>
        <authenticationService enabled="true" requireSSL="false" />
        <roleService enabled="true" />
      </webServices>
    </scripting>
  </system.web.extensions>
  
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />

    <modules runAllManagedModulesForAllRequests="true">
      <add name="DomainServiceModule" preCondition="managedHandler" type="System.ServiceModel.DomainServices.Hosting.DomainServiceHttpModule, System.ServiceModel.DomainServices.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3765AD364E35" />
    </modules>
  </system.webServer>
  
  <system.serviceModel>
    <client />
    <behaviors>
      <serviceBehaviors>
        <behavior name="AppServicesBehavior">
          <serviceMetadata httpGetEnabled="true" />
        </behavior>
        <behavior name="ReportServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="WebBehavior">
          <webHttp />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="userHttp">
          <security mode="None" />
        </binding>
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="System.Web.ApplicationServices.AuthenticationService" behaviorConfiguration="AppServicesBehavior">
        <endpoint contract="System.Web.ApplicationServices.AuthenticationService" binding="basicHttpBinding" bindingConfiguration="userHttp" bindingNamespace="http://asp.net/ApplicationServices/v200" />
      </service>
      <service name="System.Web.ApplicationServices.RoleService" behaviorConfiguration="AppServicesBehavior">
        <endpoint contract="System.Web.ApplicationServices.RoleService" binding="basicHttpBinding" bindingConfiguration="userHttp" bindingNamespace="http://asp.net/ApplicationServices/v200" />
      </service>
      <service name="Telerik.Reporting.Service.ReportService" behaviorConfiguration="ReportServiceBehavior">
        <endpoint address="" binding="basicHttpBinding" contract="Telerik.Reporting.Service.IReportService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="resources" binding="webHttpBinding" behaviorConfiguration="WebBehavior" contract="Telerik.Reporting.Service.IResourceService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>
    </services>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
  <connectionStrings>
    ''''''''''''''''
  </connectionStrings>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel" switchValue="Critical, Error, Warning" propagateActivity="true">
        <listeners>
          <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData="C:\Projects\Log\Traces.svclog" />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

</configuration>
&#13;
&#13;
&#13;

有人可以告诉我为什么之前配置的Win 2012服务器现在还无法加载已部署的应用程序,而我仍然可以从VS 2013运行? 或者有没有办法让Fiddler给出更详细的错误?

我设置了跟踪,但日志没有提供更好的线索。

感谢。

1 个答案:

答案 0 :(得分:0)

您可能在开发计算机上安装了RIA服务,但服务器上未安装RIA服务。

您有两种选择:

  1. 请记住在部署到

  2. 的每台服务器上安装RIA服务
  3. RIAServices.Server NuGet包添加到* .Web项目中。这会将RIAServices dll的私有本地副本添加到您的解决方案中。