在IIS 5.1上部署Silverlight 4应用程序时出现数据库连接问题

时间:2011-09-08 13:39:23

标签: database silverlight iis web-config wcf-ria-services

我是开发Silverlight应用程序的新手,在部署应用程序后我遇到了数据库连接问题(我可以正常访问应用程序,但由于数据库问题我无法登录)。

以下是我的错误消息

Unhandled Error in Silverlight Application Load operation failed for query 'Login'. The remote server returned an error: NotFound.
   at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.End(IAsyncResult result)
   at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.c__DisplayClass1.b__0(Object state)
   at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.RunInSynchronizationContext(SendOrPostCallback callback, Object state)
   at System.ServiceModel.DomainServices.Client.ApplicationServices.AuthenticationOperation.HandleAsyncCompleted(IAsyncResult asyncResult)
   at System.ServiceModel.DomainServices.Client.AsyncResultBase.Complete()
   at System.ServiceModel.DomainServices.Client.ApplicationServices.WebAuthenticationService.HandleOperationComplete(OperationBase operation)
   at System.ServiceModel.DomainServices.Client.LoadOperation.c__DisplayClass4`1.b__0(LoadOperation`1 arg)
   at System.ServiceModel.DomainServices.Client.LoadOperation`1.InvokeCompleteAction()
   at System.ServiceModel.DomainServices.Client.OperationBase.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.LoadOperation.Complete(Exception error)
   at System.ServiceModel.DomainServices.Client.DomainContext.CompleteLoad(IAsyncResult asyncResult)
   at System.ServiceModel.DomainServices.Client.DomainContext.c__DisplayClass1b.b__17(Object )

这是我的连接字符串

<connectionStrings>  
  <remove name="LocalSqlServer" />
  <add name="LocalSqlServer" connectionString="server=.;data source=PC15\SQLEXPRESS;Initial Catalog=LodeSuiteDB;Integrated Security=True;" />
  <add name="LodeSuiteDB1Entities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=PC15\SQLEXPRESS;initial catalog=LodeSuiteDB;integrated security=True;multipleactiveresultsets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />
</connectionStrings>

有没有人有同样的问题?我正在使用Visual Studio 2010 Ultimate Edition和SQL Server 2008进行开发(均在Windows 7上运行),而我的IIS服务器(IIS 5.1)在Windows XP Professional上运行

我一直试图解决这个问题几天无济于事。非常感谢您的帮助!

2 个答案:

答案 0 :(得分:0)

问题是ASPNET_WP进程(在IIS5.1上托管ASP.NET代码)将以ComputerName / ASPNET帐户的身份运行。

由于您在连接字符串中使用集成安全性,因此需要授予帐户访问正在访问的SQL数据库的权限。

或者,您需要在web.config中启用模拟,并指定有权访问数据库的帐户的用户名和密码。

答案 1 :(得分:0)

我认为这不是数据库连接问题。这里的问题看起来更像是Silverlight应用程序无法通过WCF RIA Services与应用程序服务器通信。使用Fiddler查看一些RIA服务电话,看看是否有任何错误。

This link有关如何解决RIA Services NotFound错误的更多帮助。