Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I determine a dll is compiled using framework 3.5 or not?

6 views
Skip to first unread message

Afshar

unread,
Nov 15, 2008, 5:25:31 AM11/15/08
to
Hi there,

We have newly upgraded to VS 2008 but I want to check if everything is
just in .net framework 3.5 or not.

Thanks in Advance
afshar

Kerem Gümrükcü

unread,
Nov 15, 2008, 8:09:13 AM11/15/08
to
Hi Afshar,

you can do this by using the unmanaged api functions for the .net runtime:

[GetRequestedRuntimeVersion]
http://msdn.microsoft.com/en-us/library/ms231649.aspx

It will show you what runtime your application needs in order to
run successfully on a system. I also recommend you to have a look
at other Hosting (Unmanaged API Reference) Functions/Interfaces
in the documentation.

I made a .NET Pinvoke Translation of the Function, if you want to check
another .NET Exe from your running .NET Application:

[DllImport("mscoree.dll",CharSet=CharSet.Unicode)]
public static extern Int32
GetRequestedRuntimeVersion([In][MarshalAs(UnmanagedType.LPWStr, SizeConst =
260)]string pExe,
[Out]StringBuilder pVersion,
[In] Int32 cchBuffer,
[Out] out Int32 pdwLength);


Regards

Kerem

"Afshar" <afshar....@gmail.com> schrieb im Newsbeitrag
news:1b70074e-bf76-4e3a...@z6g2000pre.googlegroups.com...

0 new messages