部署的Silverlight应用程序没有';从本地PC移动到远程服务器后,无法使用数据库

本文关键字:服务器 数据库 移动 PC 应用程序 Silverlight 部署 | 更新日期: 2023-09-27 18:27:47

昨天我完成了我的第一个Silverlight应用程序。此应用程序通过实体模型和域服务类与数据库(另一个远程服务器上的SQL服务器)通信。当我在电脑上测试它时,一切都很好。因此,我首先将这个项目部署到本地,然后将其转移到远程服务器。

问题是,在移动到服务器之后,WCF RIA无法与服务器通信(回调引发一个错误,即找不到服务器-仅此而已)。

我怎样才能找出这个错误的来源;我有点绝望,因为我从未使用过IIS。我尝试了Web Deploy选项,但它无法连接到远程服务器。在我的本地电脑上,我有IIS 8 Express,在我需要移动网站的远程服务器上是IIS 7(MS server 2008)。

我的Web.Config文件

<configuration>
  <system.webServer>
    <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=31bf3856ad364e35"/>
    </modules>
    <validation validateIntegratedModeConfiguration="false"/>
  </system.webServer>
  <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>
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
      </assemblies>
    </compilation>
    <httpRuntime/>
  </system.web>
  <connectionStrings>
    <add name="ISPRSWebFormTestEntities" connectionString="metadata=res://*/EntityModel.csdl|res://*/EntityModel.ssdl|res://*/EntityModel.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=sql.fce.cz''MSSQL2012,1433;initial catalog=testDB;user id=reviewer;password=xxxxxxxxxx;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient"/>
  </connectionStrings>
  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true"/>
  </system.serviceModel>
</configuration>

部署的Silverlight应用程序没有';从本地PC移动到远程服务器后,无法使用数据库

请提供更多错误信息进行诊断。此外,您必须仔细检查以下设置。1.ConnectionString。请确认连接字符串是否正确,并且能够连接到远程服务器。2.Web服务。请尝试访问IE中的svc文件,确认web服务工作正常。