[Mono-list] targeting and running a specific .Net version
Miguel de Icaza
miguel at novell.com
Thu May 8 14:20:19 EDT 2008
Hello,
> when I look under mono/lib/mono/ I see 4 different versions:
>
> 1.0 2.0 2.1 3.5
I have updated the documentation to explain what this means, attached is
the documentation:
PACKAGES
Depending on the invocation for the C# compiler (mcs, gmcs, or
smcs) you will get a default set of libraries and versions of
those libraries that are referenced.
The compiler uses the library path to locate libraries, and is
able to reference libraries from a particular package if that
directory is used. To simplify the use of packages, the C# com‐
piler includes the -pkg: command line option that is used to load
specific collections of libraries.
Libraries visible to the compiler are stored relative to the
installation prefix under PREFIX/lib/mono/ called the PACKAGEBASE
and the defaults for mcs, gmcs and smcs are as follows:
mcs References the PACKAGEBASE/1.0 directory
gmcs References the PACKAGEBASE/2.0 directory
smcs References the PACKAGEBASE/2.1 directory
Those are the only runtime profiles that exist. Although other
directories exist (like 3.0 and 3.5) those are not really runtime
profiles, they are merely placeholders for extra libraries that
build on the 2.0 foundation.
Software providers will distribute software that is installed rel‐
ative to the PACKAGEBASE directory. This is integrated into the
gacutil tool that not only installs public assemblies into the
Global Assembly Cache (GAC) but also installs them into the PACK‐
AGEBASE/PKG directory (where PKG is the name passed to the -pack‐
age flag to gacutil).
As a developer, if you want to consume the Gtk# libraries, you
would invoke the compiler like this:
$ mcs -pkg:gtk-sharp-2.0 main.cs
The -pkg: option instructs the compiler to fetch the definitions
for gtk-sharp-2.0 from pkg-config, this is equivalent to passing
to the C# compiler the output of:
$ pkg-config --libs gtk-sharp-2.0
Usually this merely references the libraries from PACKAGEBASE/PKG.
Although there are directory names for 3.0 and 3.5, that does not
mean that there are 3.0 and 3.5 compiler editions or profiles.
Those are merely new libraries that must be manually referenced
either with the proper -pkg: invocation, or by referencing the
libraries directly.
More information about the Mono-list
mailing list