Reputation: 333
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 against 3.0 or 3.5. Is there a API for this?
Upvotes: 1
Views: 5018
Reputation: 692
i didn't test this in .NET , but in NetFramework you can use referenced assemblies :
Assembly wpfAssembly = Assembly.GetAssembly(typeof(System.Windows.Application));
Version wpfVersion = wpfAssembly.GetName().Version;
Console.WriteLine("=========>> WPF Version: " + wpfVersion.ToString());
Upvotes: 0
Reputation: 11003
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.
Upvotes: 3
Reputation: 2828
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.
Upvotes: 1