I am trying to check which version of the framework is being used by another .NET application through the assembly. I found two ways to get the version of the framework (first through ImageRunetimeVersion and with FullName of the assembly), but I get two different values from it, and I don’t know what is correct:
Assembly ass = Assembly.LoadFrom(autPath);
string imageRuntimeVersion = ass.ImageRuntimeVersion;
Console.WriteLine("ImageRunetimeVersion: " + imageRuntimeVersion);
Console.WriteLine("FullName: " + ass.FullName);
Console.WriteLine("");
Console.WriteLine("----");
Console.WriteLine("Referenced Assemblies: ");
Console.WriteLine("");
AssemblyName[] referencedAssemblies = ass.GetReferencedAssemblies();
foreach (AssemblyName a in referencedAssemblies)
{
Console.WriteLine(a.FullName);
}
if I am going to test this using my application and, for example, paint.net, the results:
As you can see, I can’t say which “version” is correct. The biggest problem is that if I'm going to take a look at my project properties for my .net application, the target platform is 3.5, not 2.0 or 1.0 -
source
share