我最近完成了我使用Windows 8开发的第一个WPF应用程序.它在我的机器上工作正常.我的一个朋友也在他的Windows 8机器上的visual studio中运行它,这很有效.我在我的机器上单击一次安装程序,它安装得很好并运行.
我在虚拟机上安装了Windows 7,并尝试使用单击一次安装它.它取得了.NET 4.5和SQL Server Compact,安装过程似乎完美无瑕.当Windows 7尝试运行该应用程序时,没有任何有用的事情发生.我在Virtualbox中安装了Visual Studio,并且能够获得此堆栈跟踪.
我查阅了Google上的PresentationFramework.Aero2,发现了3个SO问题和一个MSDN问题.MSDN问题给了我一些我认为可能的暗示.如果我去C:\ Windows\Microsoft.NET\Framework\4.0\WPF没有PresentationFramework.Aero2.dll文件,而在Windows 8上有...所以我复制并粘贴到Windows 7等效的地方希望实现某些目标,但没有任何结果.
这是堆栈跟踪:
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, Boolean skipJournaledProperties, Object rootObject, 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 …Run Code Online (Sandbox Code Playgroud)