[Mono-list] How to detect which version of Mono a library is compiled with?
jonpryor at vt.edu
Wed May 16 18:23:51 UTC 2012
On May 11, 2012, at 2:54 PM, IBBoard wrote:
`monodis --assemblyref` will tell you which assemblies an assembly references, including version numbers, but (1) I don't know if monodis is in a -dev package or not (I imagine it is), and (2) I'm not sure that would actually help you, as you'd need to "somehow" find an assembly to run monodis against. Running it against your app won't help -- you know it's a 2.0 app -- so you'd presumably want System.dll or gtk-sharp.dll or something, and how do you find the appropriate path for _that_?
I'd suggest a different hack:
bindir=$(dirname `which mono`)
if [ -d "$bindir/../lib/mono/2.0" ]; then
# you have the 2.0 runtime...
# you don't; try for the 4.0 runtime and use `mono --runtime`...
You may also need to check for lib64 in addition to lib (iirc Fedora likes lib64).
In general, if $prefix/lib/mono/2.0 exists, then the 2.0 profile exists.
More information about the Mono-list