Developing with C# on OSX and Mono

后端 未结 5 1601
不思量自难忘°
不思量自难忘° 2021-02-03 10:40

I\'m about to start a project that requires me to write c# code. The thing is, I\'ve got a mac.

I was wondering if there are any pitfalls involved in c# development usin

5条回答
  •  长发绾君心
    2021-02-03 11:23

    Based on your comment to HiVoltRock's answer (ASP.NET development), I'd say Mono 2.10.1 and MonoDevelop will be just fine (the stable release of MonoDevelop works just fine, but for development on OS X I prefer to use the most recent version which I compile from Git).

    There are some things to take into account, such as file paths (ie: if the windows devs are writing static paths such as ApplicationsInstallDirectory + "\data\templates\foo.bar"; you will run into problems as directory separators on Mac OS are forward slashes. Also if existing code is using P/Invoke or other specific Window's functionality you'll be in trouble.

    Finally if your code base uses third party libraries that requires Windows this could cause you issues.

    For reference our product has been designed since day one with a requirement that it runs on Mono on Linux or OS X. With that in mind we've made sure to consider everything with cross-platform execution in mind. If you're joining an existing product, the same considerations might not have been given, meaning a lot of the existing code isn't compatible with Mono.

    The Mono Migration Analyser will help determine if you've got any incompatible code.

    There is a bit of fud out there about developing under Mono. Our project is an MVC3 with Razor, running .NET 4 using NHibernate, StructureMap etc and there haven't been that many issues developing on a non-Windows machine.

提交回复
热议问题