2011-03-28 61 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服務客戶端的問題,或者是否有任何不正確初始化的靜態對象會導致這種情況發生。

希望這有助於別人有一天...