2015-09-18 16 views
10

私はVS 2012でデバッグするときに使用したWPFアプリケーションで作業しています。 Visual Studio 2015に切り替えたので、これ以上デバッグできません。実行時にSystem.Windows.Markup.XamlParseExceptionが発生し、アプリケーションがクラッシュします。 コンパイルされた実行可能ファイルは、そのアイコンをダブルクリックして起動すると正しく実行されることに注意してください。私はそれが起動された後にプロセスをアタッチすることによってVS 2015でそれをデバッグすることさえできます。Visual Studio 2015でWPFアプリケーションをデバッグするときのXamlParseException

私のアプリケーションでは、xceed.wpf.toolkitを使用しています。

例外がある:

System.Windows.Markup.XamlParseException occurred 
    HResult=-2146233087 
    LineNumber=58 
    LinePosition=15 
    Message='Initialization of 'Xceed.Wpf.Toolkit.BusyIndicator' threw an exception.' Line number '58' and line position '15'. 
    Source=PresentationFramework 
    StackTrace: 
     at System.Windows.Markup.XamlReader.RewrapException(Exception e, IXamlLineInfo lineInfo, Uri baseUri) 
     at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri) 
     at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri) 
     at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream) 
     at [...].InitializeComponent() 
    InnerException: 
     HResult=-2146233088 
     LineNumber=0 
     LinePosition=0 
     Message=Initialization of 'Xceed.Wpf.Toolkit.Core.VersionResourceDictionary' threw an exception. 
     Source=System.Xaml 
     StackTrace: 
      at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin) 
      at System.Xaml.XamlObjectWriter.Logic_EndInit(ObjectWriterContext ctx) 
      at System.Xaml.XamlObjectWriter.WriteEndObject() 
      at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter) 
      at System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled) 
      at System.Windows.SystemResources.ResourceDictionaries.LoadThemedDictionary(Boolean isTraceEnabled) 
      at System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache) 
      at System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference) 
      at System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce) 
      at System.Windows.FrameworkElement.UpdateThemeStyleProperty() 
      at System.Windows.FrameworkElement.OnInitialized(EventArgs e) 
      at System.Windows.FrameworkElement.TryFireInitialized() 
      at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin) 
     InnerException: 
      HResult=-2146232800 
      Message=Cannot locate resource 'xceed.wpf.toolkit;v2.1.0.0;themes/xceed.wpf.toolkit;v2.1.0.0;component/themes/aero/brushes_normalcolor.xaml'. 
      Source=PresentationFramework 
      StackTrace: 
       at MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access) 
       at System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access) 
       at System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream() 
       at System.IO.Packaging.PackWebResponse.get_ContentType() 
       at MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response) 
       at MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType) 
       at System.Windows.ResourceDictionary.set_Source(Uri value) 
       at Xceed.Wpf.Toolkit.Core.VersionResourceDictionary.System.ComponentModel.ISupportInitialize.EndInit() 
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin) 
      InnerException: 

注また、(正しいバージョン、v2.1.0.0に)関与する成分、Xceed.Wpf.Toolkit.dllだけ、出力ディレクトリに存在することアプリケーションのコンパイルされた実行可能ファイルの近くにあります。

VS 2015統合デバッガを使用してアプリケーションを動作させるための提案はありますか?

ありがとうございます!

+0

注:xceed.wpf.toolkit.dllコンポーネントをILSpyで開いたところ、xceed.wpf.toolkit; v2.1.0.0; themes/xceed.wpf.toolkit; v2 .1.0.0; component/themes/aero/brushes_normalcolor.xaml ' –

答えて

13

無効にしました

デバッグ|一般| XAMLのUIデバッグツールを有効にして

オプションを使用すると、すべてが再び機能し始めました。

enter image description here

+0

この記事は役に立つかもしれない:http://blogs.msdn.com/b/visualstudio/archive/2015/02/24/introducing-the-ui -debugging-tools-for-xaml.aspx –

+0

私はこの問題を抱えていましたが、この修正は私のために働いています。ありがとう ! – shanmugharaj

0

あなたはthis

をチェックして、pack:...構文を使用することをお勧めします。

ツールキットには、以前のバージョンではなくVS2015でのみ問題が発生するという問題があります。 VSの最新バージョンと以前のバージョンの違いを理解しておく必要がありますが、少なくともこのパッチは機能します。

関連する問題