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-675a163988d09791217086/] 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-675a163988d10393972958/] 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-675a163988d11762560192/]
  3. Compile the version.cs along with the monotouch.dll library using the following command:
    [crayon-675a163988d13848481695/]
  4. Run the resulting version.exe file using the following command:
    [crayon-675a163988d14454330824/]

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

Gogogo!