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

本文关键字:返回 错误 应用程序 Silverlight WCF 部署 | 更新日期: 2023-09-27 17:53:09

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

我的网页。配置文件如下所示:

<?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>

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

我设置了跟踪,但是日志没有给出任何更好的线索。

谢谢。

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

有可能您在开发机器上安装了RIA服务,但它没有安装在服务器上。

你有两个选择:

  1. 请记住在部署到

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