问题
in my project I am trying to use the Avalon Wizard component.
I can build and execute my program without problems but I am not able to run it inside Visual Studio 2015 in debugging mode.
It claims that the resource "avalonwizard;v1.2.0.0;themes/avalonwizard;component/themes/aerowizardheader.xaml" cannot be found.
I installed Avalon Wizard using Nuget (but it also fails if I add the assembly manually to my project).
I used the newest version of Avalon Wiszard (1.2.0.0).
It makes no difference if I target my project at .net 4 or 4.5x.
As I said this error only occurs in debugging mode. There is no compilation error and I can start the program without errors outside of Visual Studio 2015.
MainWindow.xaml:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:TestNugetAvalonWizard"
xmlns:Custom="http://schemas.pavel.fedarovich.com/winfx/2010/xaml/presentation" x:Class="TestNugetAvalonWizard.MainWindow"
mc:Ignorable="d"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Custom:Wizard>
<Custom:WizardPage/>
<Custom:WizardPage/>
<Custom:WizardPage/>
</Custom:Wizard>
</Grid>
Full stack trace:
System.Windows.Markup.XamlParseException ist aufgetreten.
HResult=-2146233087
LineNumber=13
LinePosition=14
Message=Zeilennummer "13" und Zeilenposition "14" von "Bei der Initialisierung von "AvalonWizard.WizardPage" wurde eine Ausnahme ausgelöst.".
Source=PresentationFramework
StackTrace:
bei System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
InnerException:
HResult=-2146233088
LineNumber=0
LinePosition=0
Message=Beim Festlegen der Eigenschaft "System.Windows.ResourceDictionary.Source" wurde eine Ausnahme ausgelöst.
Source=System.Xaml
StackTrace:
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
bei MS.Internal.Xaml.Runtime.PartialTrustTolerantRuntime.SetValue(Object obj, XamlMember property, Object value)
bei System.Xaml.XamlObjectWriter.Logic_ApplyPropertyValue(ObjectWriterContext ctx, XamlMember prop, Object value, Boolean onParent)
bei System.Xaml.XamlObjectWriter.Logic_DoAssignmentToParentProperty(ObjectWriterContext ctx)
bei System.Xaml.XamlObjectWriter.Logic_AssignProvidedValue(ObjectWriterContext ctx)
bei System.Xaml.XamlObjectWriter.WriteEndMember()
bei System.Xaml.XamlWriter.WriteNode(XamlReader reader)
bei System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
bei System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter)
bei System.Windows.SystemResources.ResourceDictionaries.LoadDictionary(Assembly assembly, String assemblyName, String resourceName, Boolean isTraceEnabled)
bei System.Windows.SystemResources.ResourceDictionaries.LoadThemedDictionary(Boolean isTraceEnabled)
bei System.Windows.SystemResources.FindDictionaryResource(Object key, Type typeKey, ResourceKey resourceKey, Boolean isTraceEnabled, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean& canCache)
bei System.Windows.SystemResources.FindResourceInternal(Object key, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference)
bei System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce)
bei System.Windows.FrameworkElement.UpdateThemeStyleProperty()
bei System.Windows.FrameworkElement.OnInitialized(EventArgs e)
bei System.Windows.FrameworkElement.TryFireInitialized()
bei System.Windows.FrameworkElement.EndInit()
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.InitializationGuard(XamlType xamlType, Object obj, Boolean begin)
InnerException:
HResult=-2146232800
Message=Die Ressource "avalonwizard;v1.2.0.0;themes/avalonwizard;component/themes/aerowizardheader.xaml" kann nicht gefunden werden.
Source=PresentationFramework
StackTrace:
bei MS.Internal.AppModel.ResourcePart.GetStreamCore(FileMode mode, FileAccess access)
bei System.IO.Packaging.PackagePart.GetStream(FileMode mode, FileAccess access)
bei System.IO.Packaging.PackWebResponse.CachedResponse.GetResponseStream()
bei System.IO.Packaging.PackWebResponse.GetResponseStream()
bei System.IO.Packaging.PackWebResponse.get_ContentType()
bei MS.Internal.WpfWebRequestHelper.GetContentType(WebResponse response)
bei MS.Internal.WpfWebRequestHelper.GetResponseStream(WebRequest request, ContentType& contentType)
bei System.Windows.ResourceDictionary.set_Source(Uri value)
bei System.Windows.Baml2006.WpfSharedBamlSchemaContext.<>c__DisplayClass0.<Create_BamlProperty_ResourceDictionary_Source>b__453(Object target, Object value)
bei System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
bei MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
InnerException:
Can anybody help me with this?
来源:https://stackoverflow.com/questions/31580864/avalon-wizard-resource-not-found-during-debugging-in-visual-studio-2015