In revision 983 SharpDevelop2 has support for Mono's GAC. It also includes new Gtk# and Glade# project templates, and a Gtk# Window file template. Mono can be downloaded from
here Creating a new Glade# Project- Select the menu option File | New | Solution to open the "New Project" dialog.
- Select the C# category.
- There are two new projects here, a Gtk# project and a Glade# project. Select the Glade# project.

- Enter a name for the project and select the "Create" button to generate the project.

The generated project will target Mono 1.1 by default, and will use Mono's Mcs compiler.
Running the Glade# ApplicationIf you have the Mono bin directory (e.g. C:\Program Files\Mono\bin) added to your Path environment variable, the project can be started by selecting the menu option Debug | Run or Debug | Run without debugger. This will run the application under the Microsoft .NET framework and not Mono itself, to run under Mono see this
post.
Note that you cannot debug the application when it is built with either of the Mono compilers.
Adding a Mono GAC Reference- Open the Project Browser via View | Project.
- Select the "References" node, right click and select "Add Mono Reference".

- Select the GAC entry that will be added to the project, click the
Select button and then click the OK button to add the reference to the
project.

Code CompletionThere is a small problem with code auto-completion. In order for auto-completion to work the reference must be added via the "Add Mono Reference" dialog. So the first time a Glade# or Gtk# project has been created you will have to remove the GAC references and then re-add them to get code auto-completion working. This only needs to be done once, not every time a Gtk# or Glade# project is created.
Debugging a Mono ApplicationYou cannot debug a Mono app built using Mcs or Gmcs. The Mono compilers create their own open source debugging symbols binary (.mdb) which SharpDevelop and Microsoft's DbgCLR do not support. There is also no Mono debugger available for Windows. In order to debug a Mono app it needs to be built using the Microsoft Csc compiler. The general guidelines to be able to debug your Mono app using the SharpDevelop debugger are:
- Make sure all Mono specific GAC references have "Local Copy" set to
true. Select the reference in the Project Browser and select
Properties to set this.
- The Mono bin directory (e.g. C:\Program Files\Mono\bin) must be added to the Path environment variable.
- Change the "Target Framework" (Project | Project Options | Compiling) to one of the Microsoft .NET frameworks.
- Remove and re-add your Mono GAC references using the "Add Mono
Reference" dialog. You should only need to do this once and only if
you are using a project created from the Glade# or Gtk# templates.
Doing this will add a HintPath to the references in your MSBuild
project so the Microsoft compilers can locate the assemblies in the
Mono GAC. These HintPaths are not currently added to a newly created
Glade/Gtk# project.
- Rebuild your application.
Once the HintPaths have been added to your MSBuild project you should be able to switch between the Microsoft and Mono frameworks as required, and build your code using the Microsoft or Mono compilers.
If you are going to debug a Gtk# or Glade# application you will need to add extra GAC references. Mcs and Gmcs do not need all Gtk# references to be added, but Microsoft's Csc compiler does. For a Gtk# app you will need at least:
- atk-sharp
- gdk-sharp
- glib-sharp
- gtk-sharp
- pango-sharp
Also add glade-sharp if you are developing a Glade# app.
LinksMono DownloadsTargeting Mono with SharpDevelop2SharpDevelop Daily Builds