2011-03-28 65 views
1

我正在使用Mvvm Light(最新版本)构建Silverlight 4应用程序,而VS 2010每5分钟甚至更少崩溃。所以这是不可能的。mvvm-light工具包崩溃的视觉工作室

我相信这是因为我正在做或者我的MVVM实现有问题。

我在设计师有时会得到这个错误。

未处理的异常已经发生:

未处理的异常已经发生:Xml_CannotFindFileInXapPackage]参数:ServiceReferences.ClientConfig调试资源字符串不可用。关键和论据常常提供足够的信息来诊断问题。请参见System.Xml.Xml.XmlReader.Create(String inputUri,XmlReaderSettings settings)上System.Xml.XmlReaderSettings.CreateReader(String inputUri,XmlParserContext inputContext)处的System.Xml.XmlXapResolver.GetEntity(Uri absoluteUri,String role,Type of ObjectToReturn)上的http://go.microsoft.com/fwlink/?linkid=106663&Version=4.0.60129.0&File=System.Xml.dll&Key=Xml_CannotFindFileInXapPackage XmlParserContext inputContext)在System.ServiceModel.Configuration.ServiceModelSectionGroup.GetSectionGroup()我不知道这是否与崩溃有关。 ..我在事件查看器中发现此错误:应用程序:devenv.exe Framework版本:v4.0.30319说明:由于未处理的异常,进程已终止。异常信息:System.ObjectDisposedException堆栈:在System.Net.Browser.AsyncHelper.CheckUseLowLatencyNetworking()在System.Windows.Threading.Dispatcher.FastInvoke(System.Windows.Threading.DispatcherPriority,System.Delegate,System.Object [])at System.Net.Browser.AsyncHelper.BeginOnUI(System.Threading.SendOrPostCallback,System.Object)System.Net.Browser.BrowserHttpWebRequest.Abort()System.ServiceModel.Channels.HttpOutput + WebRequestHttpOutput.Abort(System.ServiceModel.Channels .HttpAbortReason)在System.ServiceModel.Channels.HttpChannelFactory + HttpRequestChannel + HttpChannelAsyncRequest.AbortSend()在System.ServiceModel.Channels.HttpChannelFactory + HttpRequestChannel + HttpChannelAsyncRequest.OnSendTimeout(System.Object的)在System.Threading._TimerCallback.TimerCallback_Context(System.Object的)System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,Boolean)在System.Threading._TimerCallback.PerformTimerCallba ck(System.Object)

任何帮助将不胜感激,在此先感谢。

回答

2

大多数时候,Visual Studio在WPF和Silverlight应用程序中崩溃的原因是它在设计视图中加载Xaml时遇到困难。这通常是由于XAML中的错误。

要防止此问题发生的历史:

  1. 转到工具/选项
  2. 文本编辑器 - > XAML - >其他
  3. 选中选项 “总是打开的文档在全XAML视图”。
  4. 解决xaml中的错误
  5. 取消选中点#3中提到的选项以在设计视图中查看XAML。
0

我已经解决了这个问题。我的症状是:我的Silverlight应用程序运行不正常或经常崩溃。在调试时,VS2010经常与上面完全相同的回溯导致崩溃。

我错误初始化了一个对象(尝试通过静态服务对象连接到格式不正确的WCF服务)。

return (new ServicesClientVar.Service(new Binding(), 
        new EndpointAddress(new Uri("http://:8000/FileServices")))); 

如果你看看Uri,它是错误的配置。

所以,我不确定这是否是WCF服务客户端的问题,或者是否有任何不正确初始化的静态对象会导致这种情况发生。

希望这有助于别人有一天...