View .NET assembly version on Ubuntu

When you want to view the assembly version of a .NET assembly in Windows, you just right click the DLL and view its properties. Or, you just hover the mouse over the file and the version number will be shown in the tooltip. In Linux, things aren’t as easy.

Since this is something I do very rarely, I never remember the command I have to run. Googling brings me to the correct stackoverflow answer which indicates I have to run this command:

monodis --assembly file.dll | grep Version

And indeed this does the trick. But I won’t remember it next time. So this time, I created a nautilus script to be able to right click on the file. The script looks like this:

#!/bin/bash

VERSION=`monodis --assembly "$@" | grep Version`
zenity --info --text="$VERSION"

 

I’ve saved this script as “Show assembly version” in the directory ~/.local/share/nautilus/scripts. The file manager picks this up and creates a new menu item which is available by right clicking on a file, selecting Scripts and then “Show assembly version”:

show-assembly-version

 

The assembly version will be displayed on a popup dialog. Note that the zenity command is responsible for creating the dialog, so it needs to be present in the system.

show-assembly-version-dialog

I am using Ubuntu 14.04 but the same should be possible on any desktop running nautilus as a file manager. Hope this helps.

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s