How can I know which version of WPF I am running?
I have discovered some differences between WPF 3.0 and WPF 3.5. As a result, I need to know if an assembly was compiled 开发者_C百科against 3.0 or 3.5. Is there a API for this?
The version number for the current installed version of Windows Presentation Foundation (WPF) is located in the Registry.
To find the version number:
1.
On the Start menu, click Run.
2.
In Open, type regedit.exe.
3.
Open the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Setup\Windows Presentation Foundation
The WPF version number is stored in the Version value.
You should be able to determine this from the referenced assemblies of your targeted assembly. Take a look at MSDN to check out the GetReferenceAssemblies method of the System.Reflection.Assembly class.
精彩评论