The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,570 other followers

Using ILDASM to determine the .NET Framework version an Assembly/DLL requires (via StackOverflow)

Posted by jpluimers on 2013/07/11

Josh Stodola wrote a nice answer on the Determine .NET Framework version for dll – Stack Overflow question for using ILDASM to show the required .NET Framework/CLR version for an assembly.

From that, I wrote this tiny batch file:

ildasm.exe %1 /metadata[=MDHEADER] /text /noil | find "Metadata section:"

It gives output like this:

ildasm.exe C:\Windows\Microsoft.NET\Framework\v4.0.30319\System.XML.dll /metadata[=MDHEADER] /text /noil | find "Metadata section:"
// Metadata section: 0x424a5342, version: 1.1, extra: 0, version len: 12, version: v4.0.30319

The cool thing is that older ILDASM versions work on assemblies requiring newer .NET Frameworks/CLRs.

So it is relatively future proof.

–jeroen

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

 
%d bloggers like this: