Jump to content

Mono profile in Visual Studio 2012

Posted on:July 20, 2014 at 02:00 AM

Recently I stepped upon an issue of compiling a project using Mono. Mono itself comes with a nice tool called xbuild which is an msbuild brother in the Mono world. Xbuild can be used to compile a project from the command line.

I wanted to compile my project targeting Mono under Visual Studio 2012. Unfortunately, targeting Mono (profile=Mono) does not exist in Visual Studio. The following instructions will add a new profile, and then a new target - Mono - will be available.

  1. Download and install Mono from this location.
  2. Create a Mono directory somewhere on your drive. We will later copy it to Program Files.
  3. Copy content from C:Program Files (x86)Mono-3.2.3libmono4.5 to the Mono directory.
  4. Inside the Mono directory, create a new directory called RedistList
  5. In the RedistList folder, create a file called FrameworkList.xml with the following content:<?xml version="1.0" encoding="utf-8"?><FileList Redist="Mono_3.2.3" Name="Mono 3.2.3 Profile" RuntimeVersion="4.5" ToolsVersion="4.5"></FileList>
  6. Go to C:Program Files (x86)Reference AssembliesMicrosoftFramework.NETFrameworkv4.5 and create a folder called Profile there.
  7. Copy the folder Mono (the one you created in step 2) into the Profile folder.
  8. Add the following key in your registry:HKEY_LOCAL_MACHINESOFTWAREMicrosoft.NETFrameworkv4.0.30319SKUs.NETFramework,Version=v4.5,Profile=Mono (note that this is just a key, no values inside)

Now, when you start your Visual Studio 2012, you should be able to select a target called Mono 3.2.3 Profile.