Search This Blog

Mono in Visual Studio 2010

One cool new feature in Visual Studio 2010 is enhanced Multi Targeting. Presumably, its all about allowing developers to target both the 2.0 and 4.0 runtimes from VS2010, but what it really means is you can easily target Mono from within Visual Studio 2010.

Like this:

To enable this, you need to unzip this file to:C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile

Once you do that, you can take your .NET project:

Go to project properties and switch it to the Mono 2.4 Profile:

Now it will compile using Mono's assemblies, and will flag methods that Mono does not contain, like thus:

This also works for Intellisense:

And Object Browser:

We are very excited about this feature, which should make it easy for people to ensure they are staying compatible with the Mono subset of the .NET framework without leaving Visual Studio. Once VS2010 is released, we will hopefully release the profile packs as we release each Mono version!

Is there a working version of this for the final release of vs2010 and mono v2.6.4? I'm not having any luck when I use this profile or try to create an updated profile. If it helps I'm also not seeing the client profile options in my drop down either.

This is really cool stuff. I find myself in a situation where I may require mono, but really like using the visual studio tool. I haven't found any tutorials on how to make a 2.6 version of the target profile or any tutorials on target profiles for that matter. Perhaps I'm asking the wrong questions... If you have any additional references you can point me to, I'd be very greatful. Thanks.

I am wondering if it is possible to do this with an ASP.NET MVC2 project? I have created a 2.6.4 profile and it works fine with Class Libraries, but on an MVC2 project, I do not get the Mono 2.6.4 Profile in the drop down selector. Any ideas or help?

I guess you aren't much on supporting your offerings. Visual Studio 2010 has been RTM for quite some time and the current version of Mono used by Mono-Tools is 2.6.6. Hmmm.. perhaps you could point me to someone who can follow up on this?

Been a C# developer since 1.0 so I'm not interested in using MonoDevelop and GTK#, but a way to develop in C# and being able to deploy to Linux and Mac definitely interest me. Looks like the latest version of Mono is 2.8. Any news on when a new version will be out, or can I just pop in the new dll's, rename the folder, or ? also, does this or will it support Framework 4.0?

Hi Greg, I installed your 2.8 profile as you directed. My VS2010 project builds fine however when I try to run it I get a .NET Framework Initialization Error, saying that I need to install this version (v4.0,Profile=Mono) of the framework. I am running on Windows7 64-bit. Any help would be appreciated!

@Jason I had the same problem, the error dialog telling me I should download “.NETFramework,Version=v4.0,Profile=Mono” in order to run my application.

Creating an additional registry key did the trick for me. Since I'm running Windows 7 x64, it was:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0,Profile=Mono

I suppose for x86 it’sHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v4.0,Profile=Mono

(Where v4.0.30319 would be the version of the current 4.0 framework installed.)

Popular posts from this blog

Over the holiday break, I stumbled upon this article from OSNews stating that there was a need for something like Paint.NET for Gtk. Having some experience with porting Paint.NET to Mono Winforms before, I knew that that was a massive task. But it still got me curious about Cairo and creating a layered canvas, since I had never played with Cairo or Gtk.

After playing around for a few hours, I actually had a working paintbrush and canvas. Intrigued by my success, I played around with it for a few more days. By the end of the week I had a nifty little paint program with a few features. Now, a month later, it's time to open my little project up to the world: Pinta.

Pinta is a clone of Paint.NET. It already has a small, but hopefully useful, set of features like multiple layers and infinite levels of Undo/Redo.

I hope to implement the same feature set as Paint.NET. Currently there are several tools missing, as well as adjustments like brightness/contrast and levels and Paint.NET…

As part of this year's Google Summer of Code, there were two projects that got chosen that were on my personal 'to-do' list. I was happy these projects got chosen because frankly, my to-do list is not getting shorter nor are the days getting longer.

One of these is Ed Ropple's "Cloverleaf", which is an add-in to Visual Studio designed to facilitate writing and testing applications in Mono. We decided on the following features:

- Test in Mono: Clicking this would run the current solution/project on the Mono runtime on Windows.- Scan with MoMA/Gendarme: Clicking this would run MoMA or Gendarme (which can run MoMA) on the solution/project.- Test on Linux: Clicking this would take the solution/project output and copy it to a Linux machine or virtual machine, and automatically start it.

Ed did some great work over the summer, so for my Hack Week project I started polishing and packaging his code so we could get it into people's hands. Unfortunately, I only got…