我有一个我在本地开发的Silverlight应用程序,我正在尝试在我个人设置的Windows 2008 R2服务器上运行它。一切顺利和花花公子,除了当我尝试在应用程序上授权时,它试图在本地寻找
http://localhost/crossdomainpolicy.xml
http://localhost/clientaccesspolicy.xml
它也引发了一个令人讨厌的错误:
Uncaught Error: Unhandled Error in Silverlight Application An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
at SomeService.MVServiceReference.CheckUserCompletedEventArgs.get_Result()
at SomeService.Pagini.Autentificare.AuthForm.webServiceSoapClient_CheckUserCompleted(Object sender, CheckUserCompletedEventArgs e)
at SomeService.MVServiceReference.MVWebServiceSoapClient.OnCheckUserCompleted(Object state)
答案 0 :(得分:1)
如果您的XAP文件位于http://localhost/somewhere/somefile.xap
,则不应查找clientaccesspolicy。你在使用ASP.NET开发吗?服务器托管Silverlight应用程序,同时使用IIS作为Silverlight应用程序调用的WCF服务?
Silverlight无法呈现异常细节是众所周知的。这是因为从Silverlight组件到服务的所有通信都使用托管浏览器,并且当返回带有http错误代码的错误时,浏览器只返回错误代码而不是包含异常详细信息的消息到silverlight
在服务器端激活WCF跟踪日志记录,并查看svc-log以获取真正的异常消息。
答案 1 :(得分:1)
出于跨域目的,http://localhost/,http://localhost:1234/和http://localhost:4321/都是不同的域。