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

A

Afshar

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
 
K

Kerem Gümrükcü

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top