Why can't Windows 7 load the assembly PresentationFramework.Aero2?

后端 未结 2 1700
失恋的感觉
失恋的感觉 2021-02-02 08:50

I recently finished my first WPF application I have been developing using Windows 8. It has worked fine on my machine. A friend of mine ran it in visual studio on his Windows 8

相关标签:
2条回答
  • 2021-02-02 09:06

    I ran into a similar issue. Context: Developing WPF app on Windows 8 using Visual Studio 2012, Blend for 2012, .NET 4.5. APP.XAML referenced the PresentationFramework.Aero2 for themes. Distributing App using ClickOnce.

    On Windows 8, no problems. On Windows XP/Vista/7, application would crash on part way into execution (on the first sub-page that referenced Aero2) with the aforementioned "Could not load assembly" exception recorded.

    Attempted fixes: Flag Aero2 to copy local in project (did not help), attempted to include in ClickOnce Installer (did not appear in list of available assemblies), copied to WPF folder on target Windows7 machine under c:\windows\microsoft.net\framework\v4.xx\wpf (did not help).

    Resolution:

    Replace reference in project from PresentationFramework.Aero2 to PresentationFramework.Aero and then modified XAML references to match. Could readily push to non-Windows 8 machines and have it run. Development works properly. Only difference found was the default appearance of progress bars was glossy / 3d.

    0 讨论(0)
  • 2021-02-02 09:17

    On a developer machine there are two versions of the presentation framework assemblies. Visual Studio references the "metadata only" version. When you deploy the assembly of the C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF folder it should work (see Problem with assembly PresentationFramework.Aero2)

    0 讨论(0)
提交回复
热议问题