0

我在笔记本电脑上本地开发了一个 Silverlight 应用程序。

一切正常,但是当我将它部署到服务器时,Web 服务运行良好,因为它与数据库通信并获得所需的结果。SL我的问题在于它引发此错误的前端应用程序:

Debugging resource strings are unavailable

   at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   at FrontEnd.WebService.UIDReturnCompletedEventArgs.get_Result()
   at FrontEnd.Views.Users.client_UIDReturnCompleted(Object sender, UIDReturnCompletedEventArgs e)
   at FrontEnd.WebService.Service1SoapClient.OnUIDReturnCompleted(Object state)
Caused by: [Async_ExceptionOccurred]
Arguments: 
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=4.1.10329.0&File=System.dll&Key=Async_ExceptionOccurred

所以我去了给定的链接,它说这是一个Async_ExceptionOccurred错误。这是时间问题吗?这UIDReturn是一种从数据库中取回用户 ID 的 Web 方法,这是在 Silverlight 页面的页面加载时启动的,我认为该值可能没有及时返回,因此这就是它崩溃的原因,但是它可以在本地和上工作测试服务器,所以也许这是一个 IIS 问题?

这是调用 Web 服务的地方 -

 void OnLoadCompleted(object sender, RoutedEventArgs e)
    {
        string fullUserName = WebContext.Current.User.DisplayName;
        string userName = fullUserName.Substring(fullUserName.IndexOf('\\') + 1);


        WebService.Service1SoapClient client = new WebService.Service1SoapClient();

            client.UIDReturnCompleted += new EventHandler<UIDReturnCompletedEventArgs>(client_UIDReturnCompleted);
            client.UIDReturnAsync(userName);

    }

来自fullUserName当前登录的用户,可能尚未加载此值,因此它正在中断连接。

4

1 回答 1

0

这似乎与我之前回答过的这篇文章有关:Consume WCF library in Silverlight 4 application

于 2012-05-25T11:48:30.897 回答