c# – WPF应用程序功能区崩溃

我在visual studio 2008中创建了一个带有多个窗口的程序.其中一个窗口使用 Windows功能区控件.现在程序在我的计算机上工作正常(Windows XP),但是当我想在安装了.net 3.5 SP1的新计算机上运行它时,我可以启动程序,但是当我用功能区控件打开窗口时,我遇到了崩溃.
这是我尝试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,
FrugalStructList
1& oldContainerDependents,FrugalStructList`1&
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)

有没有人之前看过这个错误或有任何提示可以帮助我?我已经删除了.net并完全重新安装了它.

解决方法

你的异常与我的异常有点不同(XamlParseException提供’System.Windows.Markup.StaticExtension’上的值引发异常.)但我认为你应该看看我的 answer here

相关文章

目录简介使用JS互操作使用ClipLazor库创建项目使用方法简单测...
目录简介快速入门安装 NuGet 包实体类User数据库类DbFactory...
本文实现一个简单的配置类,原理比较简单,适用于一些小型项...
C#中Description特性主要用于枚举和属性,方法比较简单,记录...
[TOC] # 原理简介 本文参考[C#/WPF/WinForm/程序实现软件开机...
目录简介获取 HTML 文档解析 HTML 文档测试补充:使用 CSS 选...