views:

26

answers:

1

Is there any way to obtain the AssemblyVersion of a .Net executable in Linux without using mono? What I am trying to have is a script or command that will let me obtain the AssemblyVersion on Linux boxes. I tried:

#strings file.exe | grep AssemblyVersion
but it only the string and not the number. Also checked with:
#file file.exe
but only got general information.

Any ideas?

A: 

Try to match version numbers that span a whole line:

$ strings file.exe | egrep '^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$'

In my (few) tests, the AssemblyVersion of the binary was always the last result.

Frédéric Hamidi
I tested it but none of the numbers I am getting are the AssemblyVersion. In fact, I don't see the AssemblyVerson anywhere in the strings output.
Freddy