Configure Visual Studio 2012 to use the Mono C # compiler instead of the standard csc.exe

I work in a game engine called Unity3D, whose scripting system runs on Mono. By default, Unity uses a modified version of Mono to develop / compile a script. I am customizing my Visual Studio to work better with Unity projects and various .NET extensions.

I'm currently stuck trying to configure Visual Studio to handle compiling my various assemblies. Unity uses a modified version of the old Mono compiler, and therefore I cannot use the default csc.exe file to build assemblies.

My ideal solution would be for the Visual Studios Build Solution option to process my projects using the compiler I point to, perhaps by setting up an MSBuild (.csproj) file? The disadvantage of this is the other way that I can build from in Visual Studio using the Mono mcs / gmcs compiler?

+4
source share
2 answers

One approach is to write an MSBuild / PSake script that you can run using the keyboard shortcut from VS. I wrote a blog post about connecting a build script using a keyboard shortcut . Basically, you should write a batch file that runs the MSBuild script and assigns it a key combination, say, ALT-1. Then you can use ALT-1 instead of CTRL-SHIFT-B to compile the project.

+2
source

I made a project in which Unity worked on my Mac and ran Windows / VS2008 on Parallels. In my Visual Studio solution, I referenced the corresponding Mono text files instead of the usual DLL.NET (e.g. System, System.Xml, etc.) and used the typical ones. I also wrote all my unit tests using the nUnit dll that came with the Mono distribution. Since Unity (or at least it was) uses only .cs files, just copying (via Post Build Script) them into my Unity project structure works fine. Unity will detect changes and update scripts. This method was very effective, however I used it about 2 years ago, so I'm not sure if it is still applied.

In addition, it seems that someone was faced with the problem of creating a video on how to do this: http://forum.unity3d.com/threads/120327-Video-Tutorial-How-to-use-Visual-Studio-for -all-your-Unity-development

0
source

All Articles