在OSX和Mono上使用C#开发 [英] Developing with C# on OSX and Mono

查看:69
本文介绍了在OSX和Mono上使用C#开发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将要开始一个需要我编写C#代码的项目.事情是,我有一台Mac.

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

我想知道在OSX 10.6上使用mono进行c#开发是否有任何陷阱

I was wondering if there are any pitfalls involved in c# development using mono on OSX 10.6

我认为该页面很清楚实现很清晰,但另一方面,我读到人们安装了VMWare或类似的东西才能使用Windows.我想避免这种情况.

I think the page is clear that the implementation is crisp, but on the other hand I've read that people install VMWare or something like it to use Windows. I'd like to avoid that if possible.

注意

我将在一个团队中工作,并且所有 其他人有Windows计算机

I'll be working on a team and all the other guys have Windows machines

谢谢

推荐答案

基于您对HiVoltRock答案(ASP.NET开发)的评论,我会说 MonoDevelop 就可以了(稳定的MonoDevelop版本可以很好地工作,但是对于在OS XI上进行开发,则更喜欢使用我从Git编译的最新版本.

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

需要考虑一些因素,例如文件路径(即:如果Windows开发人员正在编写诸如ApplicationsInstallDirectory + "\data\templates\foo.bar";之类的静态路径,则由于Mac OS上的目录分隔符为正斜杠,因此您将遇到问题.另外,如果存在的话)代码正在使用P/Invoke或其他特定的Window功能,您会遇到麻烦.

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.

最后,如果您的代码库使用需要Windows的第三方库,则可能会导致您出现问题.

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

作为参考,我们的产品从第一天开始就进行设计,要求它必须在Linux或OS X上的Mono上运行.考虑到这一点,我们确保考虑所有考虑跨平台执行的问题.如果您要加入现有产品,则可能没有给出相同的考虑,这意味着许多现有代码与Mono不兼容.

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.

Mono Migration Analyser 将帮助确定您是否有任何不兼容的代码.

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

关于在Mono下进行开发存在一些疑惑.我们的项目是一个带有Razor的MVC3,它使用NHibernate,StructureMap等运行.NET 4,在非Windows机器上开发的问题并不多.

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.

这篇关于在OSX和Mono上使用C#开发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆