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,860 other subscribers

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 comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.