SQACSharp said:
Thanks but this is only to check if the framework is installed.
I want to know if application abcd.exe or blabla.dll is using the
framework 2.0 , 3.0 or 3.5.
You can target a specific framework in the application/dll and I need
to know what framework version is targeted by the file at runtime. I
can get the CLR version by getting application process and by looking
at mscorlib.dll version, but look like there is no way to get "real"
FRAMEWORK version when CLR version is 2
I may not understand the question entirely. But, you can load an
assembly and then call GetReferencedAssemblies() to determine which
assemblies it references. The information returned includes version
information.
For an already-running process, it should be simpler: just look at the
DLLs that are actually loaded in the process.
One of your replies in this thread seems to indicate that you are
looking for compile-time information. Specifically, rather than the
actual assembly version of DLLs referenced, you want to know the SDK
version used to compile the program. As that's a compile-time thing,
AFAIK there is no way to obtain that information from the compiled
assembly. However, there really should be no practical use for that
information either.
If you can explain what you're actually trying to accomplish, rather
than your predetermined mechanism for accomplishing it, you might get a
better answer that is more directly useful in achieving your goal.
Pete