Using visual studio for developing mono applications

后端 未结 6 2079
眼角桃花
眼角桃花 2020-12-28 14:33

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

相关标签:
6条回答
  • 2020-12-28 14:40

    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 :)

    0 讨论(0)
  • 2020-12-28 14:43

    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.)

    0 讨论(0)
  • 2020-12-28 14:45

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

    0 讨论(0)
  • 2020-12-28 14:53

    Yes, you can develop on Visual Studio and target Mono (Mono for x86).

    Here is an answer I made on all the available possible alternative to compile against Mono on Windows. However, it's focused for Mono x86. As a summary, let's list the possible choice for VS development:

    • MonoHelper addin
    • Mono Profile

    For Android/Ios, you can also cross-compile and debug inside Visual Studio with Xamarin addin. Although it's not free for commercial huge applications, there a free version available to make small ones.

    Note: For those who wonder why in the world I would like to develop in Visual Studio on Windows, instead of MonoDevelop on Unix, let say that developer experience in MonoDevelop does not compare to VS one (especially when it comes to debugger/refactoring, the last due more to Resharper than to VS itself).

    0 讨论(0)
  • 2020-12-28 15:01

    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.

    0 讨论(0)
  • 2020-12-28 15:07

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

    0 讨论(0)
提交回复
热议问题