[Mono-dev] Detecting 4.0 Support

Robert Jordan robertj at gmx.net
Wed Jul 21 03:57:27 EDT 2010


Hi Charlie,

On 20.07.2010 21:43, Charlie Poole wrote:
> Hi All,
>
> How can I detect that Mono support for .NET 4.0 is available.

Check whether $mono-prefix/lib/mono/4.0/mscorlib.dll exists.

>
> 1) If I'm already running under Mono

$mono-prefix can be indirectly determined from

	typeof(object).Assembly.Location

> 2) If I'm not but deciding how to launch a mono process

Maybe with pkg-config:

libdir=`pkg-config --variable=libdir mono-2`
test -f "$libdir/4.0/mscorlib.dll" ...

'mono-2' will be supported by Mono 2.8.
Earlier versions are using 'mono'.

Under Windows, the Mono prefix is stored in the registry.

Robert



More information about the Mono-devel-list mailing list