I make tools to help people create wonderful things.


Speaking on MonoMac at NDC 2011

I'm going to be at NDC 2011 in Oslo, and I'll be speaking about Developing .NET Applications for the Mac App Store. The talk will provide an introduction to MonoMac and the native Mac APIs that it exposes to .NET developers, explain the structure of MonoMac apps and how they can be deployed to the Mac App store, and discuss strategies for code reuse across the platforms supported by Mono and .NET.

If you catch me outside my talk, I'll also be more than happy to discuss other Mono technologies that I've worked on such as MonoDevelop, MonoTouch, Mono for Android, ASP.NET MVC, and the use of Mono in games.

MonoDevelop Tips will Resume in May

In early February I started writing a series of MonoDevelop Tips, and after a solid run of a couple of months, I found it difficult to keep up with the challenging Mon-Tues-Weds-Thu-Fri schedule I originally set for myself, and had to take a break to catch up with all the other things I need to do. I'm building up a buffer of new posts, and I'll resume posting tips in May, on a Mon-Weds-Fri schedule. Now that MonoDevelop 2.6 beta 2 is out, I'll also start covering some of the new features in 2.6.

Please go back and read the past tips in case you missed any, and rate your favourites — comments and ratings encourage me to keep doing this.

MonoDevelop Tips: Navigate to Line in File

In an earlier post, I introduced the Navigate To dialog, which allows quickly navigating to any file or type in the solution. It has a couple more useful capabilities which are not immediately obvious.

Firstly, it's possible to go directly to a specific line in the selected file by typing a colon followed by the line number. As soon as the colon is typed, the list will narrow down to only contain files, not types or members. When you hit Enter to navigate to the file, you will be taken directly to the specified line, if it's valid.

Navigating to a specific line

This also works in the more specialized Go to File dialog.

Another hidden feature is that it's possible to access several options by clicking on the search icon in the search box.

The Navigate To options

The options that constrain the list's contents are fairly obvious. Disabling "complex matching" makes the searching faster but makes the fuzzy/acronym matching poorer.

MonoDevelop Tips: Document Outline Pad

One of my favourite pads in MonoDevelop is the document outline pad, which provides an overview of the current document and a way to jump quickly to any part of it. I like to keep it autohidden on the left side of the MonoDevelop window, so that I can quickly bring it up. You can show it using the View->Pads->Document Outline menu item, and change its position and docking to fit your workspace layout.

The document outline paf

Clicking on an item in the Document Outline pad will select or focus that item in the document. Outlines are shown for C# source, the GTK# GUI designer, XML, HTML, T4, ASP.NET, and more.

MonoDevelop Tips: Navigation History

MonoDevelop keeps track of your navigation history, like a web browser. If you jump to another file or another position inside the same file, you can easily navigate back. This is particularly useful combined with MonoDevelop's other code navigation features that make it easy to jump around your code, such as the "Go to definition" command and the Navigate To dialog. The Navigation History can get you back to wherever you were before.

To navigate back, use Ctrl-Alt-Left on Window or Linux, or Cmd-Opt-Left on a Mac. To navigate forward, use Ctrl-Alt-Right on Window or Linux, or Cmd-Opt-Right on a Mac.

These commands are also found in the Search menu, along with the Navigation History list, which shows a list of the last fifteen locations, and allows you to jump directly to any of them. Internally it keeps more history than this, but menu space is limited.

The Navigation History menu

The commands are also found in the Navigation toolbar.

The Navigation History toolbar

Navigation points are created whenever you use a command that navigates directly to something, such as opening a file, going to a definition, and so on. If you manually move the caret around a file and stay in one area for more than about 10 seconds, it may also log a navigation point there.

MonoDevelop Tips: Code Focus

Code focus is a useful feature that helps to show the structure of your code. It's activated by hovering over one of the fold markers in the text editor margin for a few seconds. The activated fold region and its parent regions are highlighted using graduated colour differences on the text editor background.

Code focus highlighting regions in the text editor

Code focus can also be toggled on and off from the keyboard using the Control-Shift-K shortcut on Windows and Linux, or Cmd-Shift-K on Mac. When activated in this way it's persistent until toggled off, and it follows the caret, highlighting whichever region it's in.

MonoDevelop Tips: Preferences, Policies and Project Options

There are several different kinds of settings in MonoDevelop — Preferences, Policies and Project Options — and the distinction between them is not immediately clear. This post aims to provide an explanation of them and what they're used for.


Preferences control MonoDevelop's behaviour and appearance, but do not directly affect projects' code or output. This means that they are user-specific, and are stored in the user profile. Examples of preferences are the text editor's colour scheme, whether the text editor shows line numbers, the font used for output pads, whether MonoDevelop jumps to errors after a build, and so on.

The Preferences dialog can be accessed from the MonoDevelop->Preferences menu item on Mac, the Tools->Options menu item on Windows, and the Edit->Preferences menu item on Linux. This is consistent with other applications on these platforms.

Project and Solution Options

Project Options are specific to projects, and affect how they're built and run. This includes things like compiler options, the name of the output file, the arguments used when running the project, and so on. These options are stored in the project file, so other users will be able to build and run the project correctly. Where possible, they are mapped to the options used by Visual Studio and the MSBuild/xbuild command-line build tools.

The Project Options dialog can be accessed from the Project->{Project Name} Options menu item, or from the Options context menu item on the project in the solution pad, or by double-clicking on the project in the solution pad.

Some options are part of a project configuration. Projects can have multiple configurations, so by switching between them you can build different outputs. Configurations will be covered in a future post.

Solution Options are similar to Project Options, but for solutions. The Solution Options dialog can be accessed from the Project-> Solution Options menu item, or from the Options context menu item on the solution in the solution pad, or by double-clicking on the solution in the solution pad.


Policies are settings that affect how projects and code are formatted and organized, such as code formatting settings, naming conventions, and so on. In many other IDEs these settings are user-specific preferences, which means that different users working on the same project do things inconsistently, or have to change their preferences depending on which project they're working. Policies ensure that these settings are consistent for different users working on a project, and make it easy to manage sets of policies across projects.

Because most policies are invariant across all projects within a solution, projects can be set to inherit the policy of their their parent solution or solution folder, and this is the default setting. This means that in most cases, policies only need to be edited on the solution, and these changes will be picked up by the projects. Policies settings panels are shown in the Project Options and Solution Options dialogs. They can be recognized by the "Policy" combo box at the top of the panel, which allows you to pick a policy to use, or set the item to inherit the policy from its parent. Alternatively, you can customize the settings, and the combo will show "Custom".

When a solution is first created, or a solution without policies is saved, it will take its initial policies from the user's default policies. From that point on, they are only stored in the solution and are not affected by changes in the user's default policies, else solutions could not be shared between users and maintain consistent policies.

While Preferences and Project Options are familiar to users of many other IDEs, policies are something unique to MonoDevelop, and hence they sometimes cause confusion. Another post will explore the policies system in more detail.

MonoDevelop Tips: Opening Multiple Solutions

Normally, MonoDevelop only allows a single instance of itself to be open, since many of its data files (preferences, code completion databases and so on) are not designed to be accessed by multiple instances at once. However, it is possible to open multiple solutions at once. In the Welcome Page, hold down the Control key while clicking in an item in the Recent Projects list. There is a hint about this feature in the status bar while you hover over these items: "Hold Control key to open in current workspace". Do this, and the solution will be opened without closing the old one.

Multiple solutions open at the same time

You can also open multiple solutions using the "Open" dialog. If you select a project or solution in the Open dialog, and a project or solution is already open, the dialog will show a "Close the existing workspace" checkbox, which is checked by default. Simply uncheck this, and open the solution.

The option to close the existing workspace when opening a solution

The reason these options are named the way they are is that MonoDevelop always has an implicit workspace. Because it's implicit, it's not displayed in the solution pad, as it would just waste space. When you open a solution, MonoDevelop normally closes the existing workspace, and creates a new one for the newly opened solution. These options allow you to override that behaviour, and instead add the newly opened solution to the existing workspace.

MonoDevelop Tips: Grouping Related Solutions with Workspaces

Workspaces can be used to organize related solutions, and provide a convenient way to open several solutions at once. Unlike projects in a solution, which can have references and build interdependencies on other project within the solution, solutions in a workspace are independent, and can be opened and built independently of the workspace and the other solutions in it.

To create a workspace, use the command File->New->Workspace, enter the desired name of the workspace, and select the location. The workspace will be saved as a mdw (MonoDevelop Workspace) file. To add existing items to workspace, right-click on it in the solution pad, and use Add->Existing Item. This allows you to add workspaces as well as solutions, since workspaces can be nested. There are also commands to Add->New Solution and Add->New Workspace, which create a new solution or workspace and add it to the workspace directly.

A workspace with a child workspace and child solutions

MonoDevelop Tips: Task Comments

A common practice when writing code is to annotate incomplete or questionable areas with comments prefixed with warnings like TODO, HACK, FIXME, and so on. MonoDevelop draws attention to these by recognizing them and highlighting them:

A task comment highlighted in the source editor

The Task List pad, accessed from View->Pads->Task List, has section that lists all of these items and allows you to jump directly to them. This is useful if you're looking for things to fix.

Task comments in the Task List pad

There are several built-in tokens for recognizing task comments, but you can define your own in Preferences->Task List. When you add a task comment token, comments with that token will be highlighted and listed the same way as the built-in ones.


You can also set different importance levels for different task tokens, and can set the colours used in the task list for the different levels.


Subscribe to Journal