Viewing the DLL version on a mac using Mono

If you work with the Mono .Net platform like I do (ie: developing mobile apps using MonotTouch and Mono for Android) it sometimes comes in handy to view the version of a DLL file in a project.

I found out a way how this to check the DLL version info when i needed to check some DLL versions of an iOS app that was already published on Apple’s AppStore.

Just use the Mono Common Intermediate Language Disassembler like this:
[crayon-6605d4e621367664598737/] Where foo is the target dll from which you want to check out the version info, naturally.

This will give you output like the example output below, including the version number:
[crayon-6605d4e621375066343165/] UPDATE: Since the above trick didn’t seem to work for the monotouch.dll (it didn’t show a version number this way) I asked Xamarin if versioning could be applied. They replied my answer by pointing to this Stackoverflow question and the answer given there as a possible solution.

Basically, it says the following:

  1. Go to the <mobileapplication.app> directory. monotouch.dll is present there as well.
  2. create a version.cs file containing the following code:
    [crayon-6605d4e621377138905399/]
  3. Compile the version.cs along with the monotouch.dll library using the following command:
    [crayon-6605d4e621379597714311/]
  4. Run the resulting version.exe file using the following command:
    [crayon-6605d4e62137b645863714/]

That should output the version number, depending on if the linker removed the field or not.

Gogogo!