Using visual studio for developing mono applications

26,237

Solution 1

You just build the applications in Visual Studio, and run them under Mono instead of under .NET. The binaries should be compatible... but you'll need to make sure you don't use any libraries which aren't available in Mono - see the Mono Application Compatibility Guidelines.

(According to that page, you need to turn off incremental builds in Visual Studio though - a point I wasn't aware of before :)

Solution 2

See this article on how to run your apps while targeting the mono framework from VS.

Solution 3

Miguel has posted this entry a while ago, so it's quite dated. You can also try this and this (all hail Web Archive!)

Solution 4

I've posted an article on how to integrate Mono 2.8 (the build for .Net 4.0) into Visual Studio 2010 here - there's a link there to another profile built for Mono 2.4 (.Net 3.5) if that's what you're aiming for.

You can integrate the new Mono 2.8 profile with 3 simple steps:

  1. Download the profile itself from here.
  2. Unzip the contents of the profile Zip to one of the following directories:

    • 32-bit systems: C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile
    • 64-bit systems: C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile
  3. The "Mono" folder in the ZIP should be directly under the "Profile" directory.

  4. Restart Visual Studio if it had been running, open the properties of the project you want to use with Mono, and select the Mono Profile for 2.8:

Note: You will not be able to select the Mono Profile straight from the New Project dialog box; for some reason, that list of profiles doesn't match. Create your project as a .Net Framework 4.0 project first, and after creation set the project properties to Mono.

If you've upgraded your MonoDevelop install to the latest version (as of today, anyway), this Visual Studio solution & Project file will open with no problem - no changes required at all.

If you encounter the problem that you need .NETFramework,Version=v4.0,Profile=Mono in order to run the application, the trick was to create registry key.

For running Windows 7 x64, it was: HKEY\_LOCAL\_MACHINESOFTWAREWow6432NodeMicrosoft .NETFrameworkv4.0.30319SKUs .NETFramework,Version=v4.0,Profile=Mono

I suppose for x86 it’s HKEY\_LOCAL\_MACHINESOFTWAREMicrosoft.NETFramework v4.0.30319SKUs.NETFramework,Version=v4.0,Profile=Mono

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

Solution 5

Since version 2.0 MonoDevelop supports VisualStudio project/solutions file format. This means that you can use the same code base on Windows with VS and .Net and on Linux with MonoDevelop and Mono. That in my opinion is the best way to go about it. There are no major reasons to run application in Mono on Windows, other than for testing purposes and for that I'd rather set up a virtual machine to test the software in native environment.

Share:
26,237
Josh
Author by

Josh

Updated on April 02, 2020

Comments

  • Josh
    Josh about 4 years

    How do I use Visual Studio to develop applications on Mono? Is this possible?