xaml 仅在win7上解析异常问题

xaml parse exception issue only on win7

我遇到了错误

id 1000 (KERNELBASE.dll)

error id 1026 System.IO.FileNotFoundException

当我在 Win 7 上尝试 运行 我的程序时( 之前 运行 很好),但它 运行 完美地赢得了 8/8.1/10。我正在 运行ning .Net Framework 4.5.

我一直在尝试删除代码,但错误只是出现在我代码的其他行上,并且一直在继续,所以有没有人知道如何修复它或知道如何找出真正导致的原因那个问题

Binding Failure occurred
Message : Managed Debugging Assistant ' Binding Failure ' has detected a problem in ' F: \ Omini \ Omini Dækberegner.exe ' .
Additional information : the assembly with the display name ' PresentationFramework.Aero2 ' could not be loaded into the binding context '

C#

        InitializeComponent();
        bredebox_nu.Focus();
        textBoxes = new List<TextBox> { bredebox_nu, profilbox_nu, Fælgestr_nu, bredebox_ny, profilbox_ny, Fælgestr_ny, oprofilbox, obredebox, oFælgestr };
        win.SourceInitialized += new EventHandler(win_SourceInitialized);
        List<biler> items = new List<biler>();

其他错误

System.Windows.Markup.XamlParseException occurred
HResult=-2146233087
Line Number = 616
Line Position = 48
Message = ' There were triggered an exception at setting the property ' System.Windows.FrameworkElement.Style ' . ' Line number ' 616 ' and line position ' 48' .
Source = Presentation Framework
Stack Trace :
   by System.Windows.Markup.WpfXamlLoader.Load ( XamlReader xamlReader , IXamlObjectWriterFactory writer factory , Boolean skipJournaledProperties , Object rootObject , XamlObjectWriterSettings settings , Uri baseUri )
   by System.Windows.Markup.WpfXamlLoader.LoadBaml ( XamlReader xamlReader , Boolean skipJournaledProperties , Object rootObject , XamlAccessLevel access level , Uri baseUri )
   by System.Windows.Markup.XamlReader.LoadBaml ( Stream stream , ParserContext parserContext , Object parent , Boolean close stream)
   by System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
   by Omini_Tires_And_rims.MainWindow.InitializeComponent() i C:\Users\Sindakewin\documents\visual studio 2015\Projects\omini_dækberegner\omini_dækberegner\MainWindow.xaml:linje 1
   by Omini_Tires_And_rims.MainWindow..ctor() i C:\Users\Sindakewin\documents\visual studio 2015\Projects\omini_dækberegner\omini_dækberegner\MainWindow.xaml.cs:linje 210
   InnerException: 
   FileName=PresentationFramework.Aero2, PublicKeyToken=31bf3856ad364e35

FusionLog ==== state information prior binding ===
LOG: Display Name = PresentationFramework.Aero2, PublicKeyToken = 31bf3856ad364e35
(Partial)
WRN: There was delivered about a partial binding for assembly:
WRN: Assemblyname: PresentationFramework.Aero2, PublicKeyToken = 31bf3856ad364e35 | Domain ID: 1
WRN: A partial binding Occurs tabloid is only given part of assemblyens display name.
WRN This may cause the binder inputting a wrong assembly.
WRN: It is recommended to give up fully specified text ID for the Assembly,
WRN: consisting of the simple name, version, culture and token for the public key.
WRN: For more information and common solutions to this problem in the white paper http://go.microsoft.com/fwlink/?LinkId=109270.
LOG: Appbase = file: /// F: / Omini /
LOG: First PrivatePath = NULL

调用程序集:Presentation Framework,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35。

LOG: This binding initiates in loadingcontex default.
LOG: User application configuration file: F: \ Omini \ Omini Dækberegner.exe.Config
LOG: User host configuration file:
LOG: User machineconfigurationsfile from C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ config \ machine.config.
LOG: Policy not applied to reference at this time (private, custom, partial, or location-based assemblybinding).
LOG: Attempting to download new URL file: /// F: /Omini/PresentationFramework.Aero2.DLL.
LOG: Attempting to download new URL file: /// F: /Omini/PresentationFramework.Aero2/PresentationFramework.Aero2.DLL.
LOG: Attempting to download new URL file: /// F: /Omini/PresentationFramework.Aero2.EXE.
LOG: Attempting to download new URL file: /// F: /Omini/PresentationFramework.Aero2/PresentationFramework.Aero2.EXE.
)
 HRESULT = -2147024894
   Message = The file or the assembly ' PresentationFramework.Aero2 , PublicKeyToken = 31bf3856ad364e35 ' or one of its dependencies could not be loaded . The specified file was not found.
   Source = mscorlib
   StackTrace:
   by System.Reflection.RuntimeAssembly._nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly location hint, Stack Crawl Mark & ​​stack field, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
        by System.Reflection.RuntimeAssembly.nLoad (AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly location hint, Stack Crawl Mark & ​​stack field, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
        by System.Reflection.RuntimeAssembly.InternalLoadAssemblyName (AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, Stack Crawl Mark & ​​stack field, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
        by System.Reflection.Assembly.Load (AssemblyName assemblyRef)
        by System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly (BamlAssembly bamlAssembly)
        by System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType (BamlType bamlType)
        by System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType (BamlType bamlType, int16 typeid)
        by System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType (int16 typeid)
        by System.Windows.Baml2006.Baml2006Reader.Process_ElementStart ()
        by System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord ()
        by System.Windows.Baml2006.Baml2006Reader.ReadObject (KeyRecord record)
        by System.Windows.ResourceDictionary.CreateObject (KeyRecord key)
        by System.Windows.ResourceDictionary.OnGettingValue (Object key, Object & value, Boolean & canCache)
        by System.Windows.ResourceDictionary.OnGettingValuePrivate (Object key, Object & value, Boolean & canCache)
        by System.Windows.ResourceDictionary.GetValueWithoutLock (Object key, Boolean & canCache)
        by System.Windows.ResourceDictionary.GetValue (Object key, Boolean & canCache)
        by System.Windows.DeferredResourceReference.GetValue (Base Value Source Internal value source)
        by System.Windows.DependencyPropertyChangedEventArgs.get_NewValue ()
        by System.Windows.Controls.Control.OnTemplateChanged (DependencyObject d, DependencyPropertyChangedEventArgs e)
        by System.Windows.DependencyObject.OnPropertyChanged (DependencyPropertyChangedEventArgs e)
        by System.Windows.FrameworkElement.OnPropertyChanged (DependencyPropertyChangedEventArgs e)
        by System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
        by System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
        by System.Windows.StyleHelper.ApplyStyleOrTemplateValue(FrameworkObject fo, DependencyProperty dp)
        by System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
        by System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
        by System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
        by System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        by System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        by System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
        by System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
        by System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
        by System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
        by System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
        by MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
        by MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)
   InnerException: 

Xaml <GridViewColumn Header="Model" Width="140" > <GridViewColumn.CellTemplate> <DataTemplate> <TextBlock x:Name="Txt" Text="{Binding Model}" Foreground="#FF00FB0B" /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn>

我从 visual studio 中的引用中删除了 PresentationFramework.Aero2 并将其替换为 PresentationFramework.Aero 并删除了一些主题并替换了名称空间,现在它在 win 7 和 win 上运行良好没有任何问题的 vista