这是我尝试catch时得到的错误文件:
System.Windows.Markup.XamlParseException: Exception has been thrown
by the target of an invocation. Error at object
‘System.Windows.Data.Binding’. —>
System.Reflection.TargetInvocationException: Exception has been thrown
by the target of an invocation. —>
System.ComponentModel.Win32Exception:
HRESULT_FROM_WIN32(ERROR_NOT_FOUND) at
Standard.HRESULT.ThrowIfFailed(String message) at
Standard.NativeMethods.GetCurrentThemeName(String& themeFileName,
String& color,String& size) at
Microsoft.Windows.Shell.SystemParameters2._InitializeThemeInfo() at
Microsoft.Windows.Shell.SystemParameters2..ctor() at
Microsoft.Windows.Shell.SystemParameters2.get_Current() — End of
inner exception stack trace — at
System.RuntimeMethodHandle._InvokeMethodFast(Object target,Object[]
arguments,SignatureStruct& sig,MethodAttributes methodAttributes,
RuntimeTypeHandle typeOwner) at
System.RuntimeMethodHandle.InvokeMethodFast(Object target,Signature sig,
RuntimeTypeHandle typeOwner) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj,BindingFlags
invokeAttr,Binder binder,Object[] parameters,CultureInfo culture,
Boolean skipVisibilityChecks) at
System.Reflection.RuntimeMethodInfo.Invoke(Object obj,CultureInfo culture)
at System.Reflection.RuntimePropertyInfo.GetValue(Object obj,
BindingFlags invokeAttr,Object[] index,CultureInfo
culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object
obj,Object[] index) at
System.Windows.Markup.StaticExtension.ProvideValue(IServiceProvider
serviceProvider) at
System.Windows.Markup.BamlRecordReader.GetStaticExtensionValue(Int16
memberId) at
System.Windows.Markup.BamlRecordReader.GetExtensionValue(IOptimizedMarkupExtension
optimizedMarkupExtensionRecord,String propertyName) at
System.Windows.Markup.TemplateBamlRecordReader.ReadPropertyWithExtensionRecord(BamlPropertyWithExtensionRecord
bamlPropertyRecord) at
System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord
bamlRecord) — End of inner exception stack trace — at
System.Windows.Markup.XamlParseException.ThrowException(String
message,Exception innerException,Int32 lineNumber,Int32
linePosition,Uri baseUri,XamlObjectIds currentXamlObjectIds,
XamlObjectIds contextxamlObjectIds,Type objectType) at
System.Windows.Markup.XamlParseException.ThrowException(ParserContext
parserContext,Int32 linePosition,String message,
Exception innerException) at
System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord
bamlRecord) at
System.Windows.Markup.TemplateBamlRecordReader.ReadNonContentRecord(BamlRecord
bamlRecord) at
System.Windows.Markup.TemplateBamlRecordReader.ReadRecord(BamlRecord
bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean
singleRecord) at
System.Windows.Markup.TemplateTreeBuilderBamlTranslator.ParseFragment()
at System.Windows.Markup.TreeBuilder.Parse() at
System.Windows.Markup.XamlTemplateSerializer.ConvertBamlToObject(BamlRecordReader
reader,BamlRecord bamlRecord,ParserContext context) at
System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord
bamlElementRecord) at
System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord
bamlRecord) at
System.Windows.Markup.BamlRecordReader.ReadElement(Int64
startPosition,XamlObjectIds contextxamlObjectIds,Object
dictionaryKey) at
System.Windows.ResourceDictionary.CreateObject(Int32 valuePosition,
Object key) at
System.Windows.ResourceDictionary.RealizeDeferContent(Object key,
Object& value,Boolean& canCache) at
System.Windows.ResourceDictionary.GetValueWithoutLock(Object key,
Boolean& canCache) at
System.Windows.ResourceDictionary.GetValue(Object key,Boolean&
canCache) at
System.Windows.DeferredThemeResourceReference.GetValue(BaseValueSourceInternal
valueSource) at
System.Windows.DependencyPropertyChangedEventArgs.get_NewValue() at
System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d,
DependencyPropertyChangedEventArgs e) at
System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs
e) at
System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs
e) at
System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs
args) at
System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex
entryIndex,DependencyProperty dp,PropertyMetadata Metadata,
EffectiveValueEntry oldEntry,EffectiveValueEntry& newEntry,Boolean
coerceWithDeferredReference,OperationType operationType) at
System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject
fo,DependencyProperty dp) at
System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject
container,FrugalStructList1& exclusionContainerDependents,
1& oldContainerDependents,FrugalStructList`1&
FrugalStructList
newContainerDependents) at
System.Windows.StyleHelper.DoThemeStyleInvalidations(FrameworkElement
fe,FrameworkContentElement fce,Style oldThemeStyle,Style
newThemeStyle,Style style) at
System.Windows.StyleHelper.UpdateThemeStyleCache(FrameworkElement fe,
FrameworkContentElement fce,Style newThemeStyle,
Style& themeStyleCache) at
System.Windows.FrameworkElement.OnThemeStyleChanged(DependencyObject
d,Object oldValue,Object newValue) at
System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe,
FrameworkContentElement fce) at
System.Windows.FrameworkElement.UpdateThemeStyleproperty() at
System.Windows.FrameworkElement.OnInitialized(EventArgs e) at
System.Windows.Controls.MenuItem.OnInitialized(EventArgs e) at
System.Windows.FrameworkElement.TryFireInitialized() at
System.Windows.FrameworkElement.EndInit() at
System.Windows.Controls.ItemsControl.EndInit() at
System.Windows.Markup.BamlRecordReader.ElementEndInit(Object& element)
at System.Windows.Markup.BamlRecordReader.ReadElementEndRecord(Boolean
fromnestedBamlRecordReader) at
System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord
bamlRecord) at System.Windows.Markup.BamlRecordReader.Read(Boolean
singleRecord) at
System.Windows.Markup.TreeBuilderBamlTranslator.ParseFragment() at
System.Windows.Markup.TreeBuilder.Parse() at
System.Windows.Markup.XamlReader.LoadBaml(Stream stream,ParserContext
parserContext,Object parent,Boolean closeStream) at
System.Windows.Application.LoadComponent(Object component,Uri
resourceLocator) at
Waak.WeegschaalProgramma.WeegAuteurWindow.InitializeComponent() at
Waak.WeegschaalProgramma.WeegAuteurWindow..ctor(WeegschaalProcessor
weegschaalProcessor)