我最近完成了我使用Windows 8开发的第一个WPF应用程序。它在我的机器上运行良好。 我的一个朋友也在他的Windows 8机器上的视觉工作室中运行,而且工作。 我在我的机器上点击一次安装程序,安装正常并运行。
我在虚拟机上安装了Windows 7,并尝试使用点击一次来安装它。 它提取了.NET 4.5和sql Server Compact,安装过程看起来完美无瑕。 当Windows 7试图运行该应用程序时,没有发生任何有用的事情。 我在virtualBox中安装了Visual Studio,并能够获得这个堆栈跟踪。
我在Google上查找了PresentationFramework.Aero2,遇到了3个SO问题和1个MSDN问题。 MSDN的问题给了我一个我认为可能的暗示。 如果我去C: Windows Microsoft.NET Framework 4.0 WPF没有PresentationFramework.Aero2.dll文件,而在Windows 8上有…所以我复制并粘贴到Windows 7的相当地方希望实现一些东西,但没有什么结果。
这里是堆栈跟踪:
比较墨迹序列化格式中的签名
WIC / WPF:System.GPS.Longitude和System.GPS.Latitude始终返回NULL(通过BitmapMetadata)
如何将构build在上游的二进制文件传递给远程下游构build的从站
如何在Windows CE设备上安装.Net Compact Framework
在WPF .NET Framework中使用自定义的任务pipe理器,如何防止进程重复?
System.Windows.Markup.XamlParseException was unhandled HResult=-2146233087 Message='Add value to collection of type 'System.Collections.ObjectModel.ObservableCollection(System.Windows.Controls.DataGridColumn)' threw an exception.' Line number '35' and line position '71'. Source=PresentationFramework LineNumber=35 LinePosition=71 StackTrace: at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader,IXamlObjectWriterFactory writerFactory,Boolean skipJournaledProperties,Object rootObject,XamlObjectWriterSettings settings,Uri baseUri) at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader,XamlAccessLevel accessLevel,Uri baseUri) at System.Windows.Markup.XamlReader.LoadBaml(Stream stream,ParserContext parserContext,Object parent,Boolean closeStream) at System.Windows.Application.LoadBamlStreamWithSyncInfo(Stream stream,ParserContext pc) at System.Windows.Application.LoadComponent(Uri resourceLocator,Boolean bSkipJournaledProperties) at System.Windows.Application.DoStartup() at System.Windows.Application.<.ctor>b__1(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,Object args,Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source,Delegate method,Int32 numArgs,Delegate catchHandler) at System.Windows.Threading.dispatcherOperation.InvokeImpl() at System.Windows.Threading.dispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,Object state) at System.Windows.Threading.dispatcherOperation.Invoke() at System.Windows.Threading.dispatcher.ProcessQueue() at System.Windows.Threading.dispatcher.WndProcHook(IntPtr hwnd,Int32 msg,IntPtr wParam,IntPtr lParam,Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd,Boolean& handled) at MS.Win32.HwndSubclass.dispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback,Delegate catchHandler) at System.Windows.Threading.dispatcher.LegacyInvokeImpl(dispatcherPriority priority,TimeSpan timeout,Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd,IntPtr lParam) at MS.Win32.UnsafeNativeMethods.dispatchMessage(MSG& msg) at System.Windows.Threading.dispatcher.PushFrameImpl(dispatcherFrame frame) at System.Windows.Threading.dispatcher.PushFrame(dispatcherFrame frame) at System.Windows.Threading.dispatcher.Run() at System.Windows.Application.Rundispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at PremierAutoDataExtractor.App.Main() InnerException: System.IO.FileNotFoundException HResult=-2147024894 Message=Could not load file or assembly 'PresentationFramework.Aero2,PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. Source=mscorlib FileName=PresentationFramework.Aero2,PublicKeyToken=31bf3856ad364e35 FusionLog=WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging,set the registry value [HKLMSoftwareMicrosoftFusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off,remove the registry value [HKLMSoftwareMicrosoftFusion!EnableLog]. StackTrace: at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName,String codeBase,Evidence assemblySecurity,RuntimeAssembly locationHint,StackCrawlMark& stackMark,IntPtr pPrivHostBinder,Boolean throwOnFileNotFound,Boolean forIntrospection,Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName,Boolean suppressSecurityChecks) at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef,RuntimeAssembly reqAssembly,Boolean suppressSecurityChecks) at System.Reflection.Assembly.Load(AssemblyName assemblyRef) at System.Windows.Baml2006.Baml2006SchemaContext.ResolveAssembly(BamlAssembly bamlAssembly) at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypetoType(BamlType bamlType) at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType,Int16 typeId) at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId) at System.Windows.Baml2006.Baml2006Reader.Process_ElementStart() at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord() at System.Windows.Baml2006.Baml2006Reader.Readobject(KeyRecord record) at System.Windows.ResourceDictionary.CreateObject(KeyRecord key) at System.Windows.ResourceDictionary.OnGettingValue(Object key,Object& value,Boolean& canCache) at System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key,Boolean& canCache) at System.Windows.ResourceDictionary.GetValueWithoutLock(Object key,Boolean& canCache) at System.Windows.ResourceDictionary.GetValue(Object key,Boolean& canCache) at System.Windows.DeferredResourceReference.GetValue(BaseValueSourceInternal valueSource) at System.Windows.DeferredAppResourceReference.GetValue(BaseValueSourceInternal valueSource) at System.Windows.DependencyObject.GetEffectiveValue(EntryIndex entryIndex,DependencyProperty dp,RequestFlags requests) at System.Windows.DependencyObject.GetValueEntry(EntryIndex entryIndex,PropertyMetadata Metadata,RequestFlags requests) at System.Windows.DependencyObject.GetValue(DependencyProperty dp) at System.Windows.Controls.DataGridHelper.GetCoercedTransferPropertyValue(DependencyObject baSEObject,Object baseValue,DependencyProperty baseProperty,DependencyObject parentObject,DependencyProperty parentProperty,DependencyObject grandParentObject,DependencyProperty grandParentProperty) at System.Windows.Controls.DataGridColumn.OnCoerceHeaderStyle(DependencyObject d,Object baseValue) at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp,EntryIndex& entryIndex,Int32& targetIndex,EffectiveValueEntry& newEntry,EffectiveValueEntry& oldEntry,Object& oldValue,Object controlValue,CoerceValueCallback coerceValueCallback,Boolean coerceWithDeferredReference,Boolean coerceWithCurrentValue,Boolean skipBaseValueChecks) at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex,EffectiveValueEntry oldEntry,OperationType operationType) at System.Windows.DependencyObject.CoerceValue(DependencyProperty dp) at System.Windows.Controls.DataGridHelper.TransferProperty(DependencyObject d,DependencyProperty p) at System.Windows.Controls.DataGridColumn.SyncProperties() at System.Windows.Controls.DataGrid.UpdateColumnSizeConstraints(IList list) at System.Windows.Controls.DataGrid.OnColumnsChanged(Object sender,NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Windows.Controls.DataGridColumnCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index,T item) at System.Windows.Controls.DataGridColumnCollection.InsertItem(Int32 index,DataGridColumn item) at System.Collections.ObjectModel.Collection`1.Add(T item) at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Add(Object value) at System.Xaml.Schema.XamlTypeInvoker.AddToCollection(Object instance,Object item) at MS.Internal.Xaml.Runtime.ClrObjectRuntime.Add(Object collection,XamlType collectionType,Object value,XamlType valueXamlType) InnerException:
如何使表格停留在另一个上面
在Windows应用程序中是否有任何基于SSRS的商业产品可以提供更丰富的用户体验?
dynamic添加控件时如何将面板滚动保持在最前面?
顶架服务崩溃
在Linux下AutoResetEvent的C ++等价物是什么?
我遇到了类似的问题。 上下文:在Windows 8上使用Visual Studio 2012,Blend for 2012,.NET 4.5开发WPF应用程序。 APP.XAML引用了PresentationFramework.Aero2的主题。 使用ClickOnce分发应用程序。
在Windows 8上,没有问题。 在Windows XP / Vista / 7上,应用程序会在上面记录的“无法加载程序集”异常的情况下(在引用Aero2的第一个子页面上)部分崩溃。
尝试修复:标记Aero2复制本地项目(没有帮助),试图包含在ClickOnce安装程序(没有出现在可用程序集列表中),复制到目标Windows7机器下的WPF文件夹下的c: windows microsoft.net framework v4.xx wpf(没有帮助)。
解析度:
将项目中的引用从PresentationFramework.Aero2替换为PresentationFramework.Aero,然后修改匹配的XAML引用。 可以随时推送到非Windows 8的机器,并运行。 开发工作正常。 只有差别发现进度条的默认外观是光泽/ 3d。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。