From: SQACSharp on
Hi,

Is there a way to determine if an application (currently running
in windows) is using the 3.0, 3.5 net framework??

I already tried several methods and lost many hours on this but I
always get the CLR version and not the "real" framework version

How do I get the used framework version (or the target framework) of
an application?

Thanks,
From: Family Tree Mike on
On 5/2/2010 5:35 AM, SQACSharp wrote:
> Hi,
>
> Is there a way to determine if an application (currently running
> in windows) is using the 3.0, 3.5 net framework??
>
> I already tried several methods and lost many hours on this but I
> always get the CLR version and not the "real" framework version
>
> How do I get the used framework version (or the target framework) of
> an application?
>
> Thanks,

3.0 and 3.5 use additional dlls on top of the 2.0 CLR. If you aren't
using the new dlls to the later version, it shouldn't matter if they are
installed.

Now .Net 4.0 will report a different number for Environment.Version.
But you didn't ask about that version.

--
Mike
From: SQACSharp on
> 3.0 and 3.5 use additional dlls on top of the 2.0 CLR.  If you aren't
> using the new dlls to the later version, it shouldn't matter if they are
> installed.

An application can be 2.0,3.0 and 3.5 without using/referencing any
new dll when targeting a particular framework. In this case we cant
check the referenced dll to identify the targeted version.
From: Arne Vajhøj on
On 02-05-2010 05:35, SQACSharp wrote:
> Is there a way to determine if an application (currently running
> in windows) is using the 3.0, 3.5 net framework??
>
> I already tried several methods and lost many hours on this but I
> always get the CLR version and not the "real" framework version
>
> How do I get the used framework version (or the target framework) of
> an application?

Try look at registry variables.

http://stackoverflow.com/questions/199080/how-to-detect-what-net-framework-versions-and-service-packs-are-installed

should get you started.

Arne
From: SQACSharp on
> Try look at registry variables.
> http://stackoverflow.com/questions/199080/how-to-detect-what-net-fram...

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