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

  • Thread starter Thread starter Afshar
  • Start date Start date
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
 
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
 
Back
Top