4

我在 Visual Studio 2008 中创建了一个带有多个窗口的程序。其中一个窗口使用窗口功能区控件。现在该程序在我的计算机(Windows XP)上运行良好,但是当我想在另一台全新安装了 .net 3.5 SP1 的计算机上运行它时,我可以启动该程序,但是当我使用功能区控件打开窗口时出现崩溃。这是我尝试 catch 时得到的错误文件:

System.Windows.Markup.XamlParseException:调用的目标已引发异常。对象“System.Windows.Data.Binding”出错。---> System.Reflection.TargetInvocationException:调用的目标已抛出异常。---> 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 () 在 Microsoft.Windows.Shell.SystemParameters2..ctor() 在 Microsoft.Windows.Shell.SystemParameters2.get_Current() --- 内部异常堆栈跟踪结束 --- 在 System.RuntimeMethodHandle._InvokeMethodFast(Object target,
在 System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfoculture) 在 System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) 在 System.Windows.Markup。在 System.Windows.Markup.BamlRecordReader.GetStaticExtensionValue(Int16 memberId) 在 System.Windows.Markup.BamlRecordReader.GetExtensionValue(IOptimizedMarkupExtension optimizeMarkupExtensionRecord, String propertyName) 在 System.Windows.Markup.TemplateBamlRecordReader.ReadPropertyWithExtensionRecord(BamlPropertyWithExtensionRecord) 的 StaticExtension.ProvideValue(IServiceProvider serviceProvider) bamlPropertyRecord) 在 System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) --- 内部异常堆栈跟踪结束 --- 在 System.Windows.Markup。XamlParseException.ThrowException(字符串消息,异常 innerException,Int32 lineNumber,Int32 linePosition,Uri baseUri,XamlObjectIds currentXamlObjectIds,XamlObjectIds contextXamlObjectIds,Type objectType)在 System.Windows.Markup.XamlParseException.ThrowException(ParserContext parserContext,Int32 lineNumber,Int32 linePosition,字符串消息, 异常 innerException) 在 System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) 在 System.Windows.Markup.TemplateBamlRecordReader.ReadNonContentRecord(BamlRecord bamlRecord) 在 System.Windows.Markup.TemplateBamlRecordReader.ReadRecord(BamlRecord bamlRecord) 在 System.Windows System.Windows.Markup.TemplateTreeBuilderBamlTranslator.ParseFragment() 处 System.Windows.Markup 处的 .Markup.BamlRecordReader.Read(Boolean singleRecord)。System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) 的 System.Windows.Markup.BamlRecordReader.ReadElementStartRecord(BamlElementStartRecord bamlElementRecord) 的 System.Windows.Markup.BamlRecordReader.ReadRecord( BamlRecord bamlRecord) 在 System.Windows.Markup.BamlRecordReader.ReadElement(Int64 startPosition, XamlObjectIds contextXamlObjectIds, Object dictionaryKey) 在 System.Windows.ResourceDictionary.CreateObject(Int32 valuePosition, Object key) 在 System.Windows.ResourceDictionary.RealizeDeferContent(Object key, System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache) 在 System.Windows.ResourceDictionary 的 Object& 值,Boolean&canCache)。在 System.Windows.DependencyPropertyChangedEventArgs.get_NewValue() 在 System.Windows.Controls.Control.OnTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) 在 System.Windows.DeferredThemeResourceReference.GetValue(BaseValueSourceInternal valueSource) 在 System.Windows.DeferredThemeResourceReference.GetValue(Object key, Boolean& canCache)。 Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 在 System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e) 在 System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args) 在 System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata 元数据, EffectiveValueEntry oldEntry, EffectiveValueEntry&newEntry,Boolean coerceWithDeferredReference, OperationType operationType) 在 System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp) 在 System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject 容器, FrugalStructList1& exclusionContainerDependents, FrugalStructList1& oldContainerDependents, FrugalStructList`1& newContainerDependents) 在 System.Windows.StyleHelper.DoThemeStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle, Style newThemeStyle, Style style) at System.Windows.StyleHelper.UpdateThemeStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldThemeStyle,在 System.Windows.StyleHelper.GetThemeStyle(FrameworkElement fe, FrameworkContentElement fce) 在 System.Windows.FrameworkElement.UpdateThemeStyleProperty() 在 System.Windows.FrameworkElement.OnThemeStyleChanged(DependencyObject d, Object oldValue, Object newValue) 的样式 newThemeStyle, Style& themeStyleCache) System.Windows.FrameworkElement.OnInitialized(EventArgs e) 在 System.Windows.Controls.MenuItem。OnInitialized(EventArgs e) 在 System.Windows.FrameworkElement.TryFireInitialized() 在 System.Windows.FrameworkElement.EndInit() 在 System.Windows.Controls.ItemsControl.EndInit() 在 System.Windows.Markup.BamlRecordReader.ElementEndInit(Object& 元素) 在 System.Windows.Markup.BamlRecordReader.ReadElementEndRecord(Boolean fromNestedBamlRecordReader) 在 System.Windows.Markup.BamlRecordReader.ReadRecord(BamlRecord bamlRecord) 在 System.Windows.Markup.BamlRecordReader.Read(Boolean singleRecord) 在 System.Windows.Markup。 System.Windows.Markup.TreeBuilder.Parse() 在 System.Windows.Markup.XamlReader.LoadBaml 中的 TreeBuilderBamlTranslator.ParseFragment()(流流,ParserContext parserContext,Object parent,Boolean closeStream)在 System.Windows.Application.LoadComponent(Object零件,Uri resourceLocator) 在 Waak.WeegschaalProgramma.WeegAuteurWindow.InitializeComponent() 在 Waak.WeegschaalProgramma.WeegAuteurWindow..ctor(WeegschaalProcessor weegschaalProcessor)

有人以前见过此错误或有任何提示可以帮助我吗?我已经删除了 .net 并完全重新安装了它。

4

1 回答 1

1

您的异常与我的异常有点不同(XamlParseException Provide value on 'System.Windows.Markup.StaticExtension' 引发了异常。)但我认为您应该在这里查看我的答案

于 2014-02-14T10:59:15.747 回答