我有一个可以访问几个 WCF 数据服务的 Silverlight 4 应用程序。
通过浏览器访问服务没有问题。
我将程序设置为以提升的信任度在浏览器之外运行。然后我可以看到通过提琴手对 WCF 服务的调用,但什么都没有回来。
如果我调试,则会收到以下错误:
$exception {System.UnauthorizedAccessException: Invalid cross-thread access.
at MS.Internal.XcpImports.CheckThread()
at System.Windows.Controls.ItemCollection.GetValueInternal(DependencyProperty dp)
at System.Windows.PresentationFrameworkCollection`1.get_CountImpl()
at System.Windows.PresentationFrameworkCollection`1.get_Count()
at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.RemoveAll()
at System.Windows.Controls.ItemContainerGenerator.RemoveAll()
at System.Windows.Controls.ItemContainerGenerator.OnRefresh()
at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
at System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Windows.Controls.ItemCollection.NotifyCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Windows.Controls.ItemCollection.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.ClearItems()
at System.Collections.ObjectModel.Collection`1.Clear()
at ClientFolderExplorer.ViewModels.DocumentExplorerViewModel.clientCatalog_ClientsLoadingComplete(Object sender, ClientLoadingEventArgs e)
at ClientFolderExplorer.Catalogs.ClientCatalog.<>c__DisplayClass3.<ExecuteClientQuery>b__2(IAsyncResult a)} System.Exception {System.UnauthorizedAccessException}
不知道从哪里开始故障排除。我在网络服务器的根目录中有crossdomain.xml
文件clientaccesspolicy.xml
,但我什至看不到这些文件被请求(在提琴手中)。
有任何想法吗?