I have a few basic questions for anyone familiar with Mono or Mono Development (whatever it's called) when it comes to programming in .net and deploying in linux (and mac if you know too). A bit about myself, I work mostly with MVC3 and MVC4, a few windows forms, and perhaps in the future mobile apps. 98% of the time in c# and the rest c++.

对于任何熟悉Mono或Mono开发(无论它叫什么)的人来说,当涉及到在.net中编程和在linux中部署(如果你知道的话,还有mac)时,我有几个基本问题要问。关于我自己,我主要使用的是MVC3和MVC4,一些windows窗体,也许是未来的移动应用。98%的时间用c#,其余的时间用c++。

1) Are you likely to get more bugs and errors versus just sticking with a windows deployment? And if so, how bad are some of the bugs, have you had projects where it doesn't work at all?

1)相对于只使用windows部署,您可能会得到更多的错误和错误吗?如果是的话,有些bug有多糟糕,你是否有过完全不能工作的项目?

2) Do you recommend programming in Visual Studio and then deploy it to a mono platform? Or is there a better IDE you recommend, like Mono (or Eclipse if possible)? Currently I use Linux as my OS and run Windows 7 with Visual Studio.

2)您是否建议在Visual Studio中进行编程,然后将其部署到mono平台上?或者有更好的IDE推荐,比如Mono(或者Eclipse,如果可能的话)?目前我使用Linux作为我的操作系统,使用Visual Studio运行Windows 7。

3) As I have several apps that are completed using .net 4.5 beta and mvc4 beta, are these compatible with the current version of Mono? If not what are the average time frames from when a framework is officially released till Mono becomes compatible?

3)由于我有几个应用程序是使用。net 4.5 beta和mvc4 beta完成的,它们是否与当前版本的Mono兼容?如果不是的话,从一个框架正式发布到Mono兼容的平均时间框架是多少?

4) I am not knowledgeable about databases. My databases are for SQL Server, would I have to change them to run on a linux server. Is this a pain or error prone? My sql server databases are created using entity code first, does this work if I have to create MySQL databases (or whatever)?

4)我不了解数据库。我的数据库是针对SQL Server的,我是否需要在linux服务器上运行它们。这是一种痛苦还是错误?我的sql server数据库首先是使用实体代码创建的,如果我必须创建MySQL数据库(或其他什么),那么这是否有效呢?

5) Currently I deploy my mvc websites to a Server 2008r2 remote server. Is there an alternative to IIS that you would use for linux? Can you provide me with a link to a tutorial on setting this up.

5)目前我将我的mvc网站部署到服务器2008r2远程服务器上。是否有一种方法可以替代IIS使用linux?你能给我提供一个关于设置的教程的链接吗?

6) If question 4 is possible, what are the losses with deploying a MVC website on linux? Speed, reliability, security, etc?

如果问题4是可能的,那么在linux上部署MVC网站有什么损失?速度、可靠性、安全性,等等?

7) Can you give me an estimate on how much disk space the mono + some kind of iis + framework etc. that this would take up? In a comparison of a Linux OS to a Windows OS, Windows takes up a TON more space; so would using this mono setup take up a TON of disk space too? (I understand the OS size comparison is not a good example.)

7)能否估计一下mono +一些iis +框架等会占用多少磁盘空间?与Linux操作系统和Windows操作系统相比,Windows占用了大量的空间;那么使用mono设置也会占用大量磁盘空间吗?(我知道操作系统的大小比较不是一个好例子。)

8) Are there any drawbacks that I may have overlooked, that you can think of? Like is there any strange problems with directory browsing, config file hirearchy, jquery/ajax issues, etc.

有什么缺点我可能忽略了,你能想到吗?比如在目录浏览、配置文件的层次化、jquery/ajax等方面有什么奇怪的问题吗?

9) Do you have any recommendations, tutorials, blogs, etc? Is there a Stack Exchange site that deals with these types of issues better than this one? (I couldn't find one, other than perhaps the Linux one.

你有什么推荐、教程、博客等吗?是否有一个堆栈交换站点比这个站点更好地处理这些类型的问题?(我找不到一个,也许是Linux的那个。

10) Although it is not a necessity for me to do this, I would like to set it up and do it just to have the option in the future but I won't waste my time on it if it is a complete waste. I have both a linux VPS and Windows VPS that I rent right now, so if I did this it would also allow me to have only a Linux remote server (possibly with less hard drive space and ram) so it would potentially save me money. So my final question is, would you recommend doing this if your situation was similar to mine?

虽然这对我来说并不是必须的,但我想把它建立起来,这样做只是为了将来有选择的机会,但如果完全是浪费的话,我不会在上面浪费时间。我现在租了一个linux VPS和Windows VPS,所以如果我这样做的话,它也只允许我有一个linux远程服务器(可能只有更少的硬盘空间和ram),所以这可能会节省我的钱。我的最后一个问题是,如果你的情况和我的相似,你会建议这样做吗?

Please answer any of the questions that you can, Thanks in advance and sorry for so many questions, Garrett Fogerlie

请回答你能回答的任何问题,提前谢谢,抱歉有这么多问题,Garrett Fogerlie

1 个解决方案

#1


32

First of all, very good questions.

首先,非常好的问题。

I do not have experience with web using ASP.Net MVC but I do have experience with ASP.Net web forms and the migration of a commercial ASP.Net application from Windows to Mono running on Linux.

我没有使用ASP的经验。但是我有使用ASP的经验。Net web表单和商业ASP的迁移。Net应用程序从Windows到Mono在Linux上运行。

I can answer some of your questions.

我可以回答你的一些问题。

1) Are you likely to get more bugs and errors versus just sticking with a windows deployment? And if so, how bad are some of the bugs, have you had projects where it doesn't work at all?

1)相对于只使用windows部署,您可能会得到更多的错误和错误吗?如果是的话,有些bug有多糟糕,你是否有过完全不能工作的项目?

I would say yes but not many. Our application is 200K + lines of code and currently I can only think of one Mono bug that exists with our code which is minor. The bug is calling the Session.Abandon method which crashes Apache. I think that you will find more bugs in the newer .Net API's but overall the framework is very stable.

我会说是,但不是很多。我们的应用程序是20万多行代码,目前我只能想到代码中存在的一个Mono bug。错误正在调用会话。放弃使用Apache崩溃的方法。我认为在新的。net API中你会发现更多的bug,但是总的来说框架是非常稳定的。

2) Do you recommend programming in Visual Studio and then deploy it to a mono platform? Or is there a better IDE you recommend, like Mono (or Eclipse if possible)? Currently I use Linux as my OS and run Windows 7 with Visual Studio.

2)您是否建议在Visual Studio中进行编程,然后将其部署到mono平台上?或者有更好的IDE推荐,比如Mono(或者Eclipse,如果可能的话)?目前我使用Linux作为我的操作系统,使用Visual Studio运行Windows 7。

I believe that there is no better IDE than Visual Studio in terms of the features/stability that it offers. However in saying this MonoDevelop is a very good IDE that is very similar to Visual Studio. It just lacks a lot of the extra features that Visual Studio offers. For example a Visual Designer for web pages and attach to process debugging. At the company I work for we use MonoDevelop on Windows/Mac and Linux. So if you are looking for a cross platform solution then go with MonoDevelop but if you don't mind using Windows as your development PC and paying for VS licenses then VS is fine.

我相信在它提供的特性/稳定性方面,没有比Visual Studio更好的IDE了。然而,说这个MonoDevelop是一个非常好的IDE,非常类似于Visual Studio。它只是缺少了Visual Studio提供的许多额外特性。例如,web页面的可视化设计器,并附加到进程调试。在我工作的公司,我们在Windows/Mac和Linux上使用MonoDevelop。所以如果你想要一个跨平台的解决方案,可以使用MonoDevelop,但是如果你不介意使用Windows作为你的开发PC,并为VS许可付费,那么VS就可以了。

Edit: As of writing Visual Studio Community Edition has been released and requires no license. There is also the possibility of using .NET Core in conjunction with your favourite editor (or Visual Studio Code, also free). The latter is supported on Windows, Linux and Mac OS X). There is also now Visual Studio for Mac.

编辑:从编写Visual Studio Community Edition开始,已经发布,不需要任何许可。也有可能使用。net Core与您最喜欢的编辑器(或Visual Studio代码,也是免费的)结合使用。后者在Windows、Linux和Mac OS X上都有支持,现在也有了Mac的Visual Studio。

3) As I have several apps that are completed using .net 4.5 beta and mvc4 beta, are these compatible with the current version of Mono? If not what are the average time frames from when a framework is officially released till Mono becomes compatible?

3)由于我有几个应用程序是使用。net 4.5 beta和mvc4 beta完成的,它们是否与当前版本的Mono兼容?如果不是的话,从一个框架正式发布到Mono兼容的平均时间框架是多少?

I don't know if these API's are supported yet. One way to find out is using the Moma tool to analyze your assemblies. The other option would be to download the latest version of Mono + MonoDevelop and try to build your solution using them. I don't know of an exact time frame that API's are released but I think generally it is very soon after the .Net release and sometimes even before Microsoft releases.

我不知道这些API是否被支持。一种方法是使用Moma工具分析程序集。另一种选择是下载Mono + MonoDevelop的最新版本,并尝试使用它们构建您的解决方案。我不知道API发布的确切时间范围,但我认为通常是在。net发布后不久,有时甚至是在微软发布之前。

4) I am not knowledgeable about databases. My databases are for SQL Server, would I have to change them to run on a linux server. Is this a pain or error prone? My sql server databases are created using entity code first, does this work if I have to create MySQL databases (or whatever)?

4)我不了解数据库。我的数据库是针对SQL Server的,我是否需要在linux服务器上运行它们。这是一种痛苦还是错误?我的sql server数据库首先是使用实体代码创建的,如果我必须创建MySQL数据库(或其他什么),那么这是否有效呢?

--> the answer should be no actually. MS released MS-SQL Server for Linux. you can download MSSQL on ubuntu in a matter of 2 apt-get commands. I do not know how to edit this part of the answer. <-- Yes it is a pain switching databases. Even more of a pain if you are using stored procedures. There are commercial programs that can convert your database tables and data from MS SQL Server to MySQL or Postgresql. We used the tools from DBConvert to convert our database schema to Postgresql. Converting the tables was the easy part. The hardest part was converting our stored procedures. Our application relies heavily on stored procedures with 900+ stored procedures in our database. I had to rewrite every stored procedure in Postgresql by hand. If your stored procedures are just straight SQL then it won't be as diffcult but if you rely heavily on TSQL then you will need to find equivalents to your code in the coding language used by the database that you choose. With Postgresql the best equivalent is PL/pgSQL. I haven't had experience with migrating the data using the commercial tools that DBConvert offers. We made a lot of changes to our database at the same time we migrated to Mono so for the data migration we wrote our own code to do the migration.

——>答案应该是否定的。MS发布了Linux的MS- sql服务器。您可以在ubuntu上下载MSSQL,只需两个apt-get命令。我不知道如何编辑这部分答案。<——是的,切换数据库很痛苦。如果您正在使用存储过程,那么更麻烦的是。有一些商业程序可以将数据库表和数据从MS SQL服务器转换为MySQL或Postgresql。我们使用了来自DBConvert的工具将数据库模式转换为Postgresql。转换表格是最简单的部分。最难的部分是转换存储过程。我们的应用程序严重依赖于数据库中包含900多个存储过程的存储过程。我必须手动重写Postgresql中的每个存储过程。如果您的存储过程是直接的SQL,那么它就不会那么困难,但是如果您严重依赖TSQL,那么您将需要使用您所选择的数据库所使用的编码语言找到与您的代码相同的东西。对于Postgresql,最好的对应是PL/pgSQL。我没有使用DBConvert提供的商业工具迁移数据的经验。在迁移到Mono的同时,我们对数据库做了很多更改,因此在数据迁移时,我们编写了自己的代码进行迁移。

5) Currently I deploy my mvc websites to a Server 2008r2 remote server. Is there an alternative to IIS that you would use for linux? Can you provide me with a link to a tutorial on setting this up.

5)目前我将我的mvc网站部署到服务器2008r2远程服务器上。是否有一种方法可以替代IIS使用linux?你能给我提供一个关于设置的教程的链接吗?

&&

& &

7) Can you give me an estimate on how much disk space the mono + some kind of iis + framework etc. that this would take up? In a comparison of a Linux OS to a Windows OS, Windows takes up a TON more space; so would using this mono setup take up a TON of disk space too? (I understand the OS size comparison is not a good example.)

7)能否估计一下mono +一些iis +框架等会占用多少磁盘空间?与Linux操作系统和Windows操作系统相比,Windows占用了大量的空间;那么使用mono设置也会占用大量磁盘空间吗?(我知道操作系统的大小比较不是一个好例子。)

Apache2 with mod_mono is used to host websites with Mono on Linux. Linux uses minimal space. We are hosting our web application using Amazon EC2. A new installation of our stack which basically includes Ubuntu, Mono, Apache2, Postgresql and Postfix only takes up 1.2 GB of space. So the answer is No Mono does not take up a huge amount of disk space. Here is a tutorial on setting up Mono on Ubuntu. I don't know of any tutorials that are exceptionally good. If you need help with this the best places to go to are the Mono IRC channel and the Mono mailing lists. Here you can speak with the community and the developers who work at Xamarin.

带mod_mono的Apache2用于在Linux上使用Mono托管网站。Linux使用最小的空间。我们正在使用Amazon EC2托管我们的web应用程序。我们的堆栈的新安装基本上包括Ubuntu、Mono、Apache2、Postgresql和Postfix只占用1.2 GB的空间。所以答案是No Mono不会占用大量的磁盘空间。这里有一个关于在Ubuntu上设置Mono的教程。我不知道有什么教程特别好。如果你需要帮助,最好去Mono IRC频道和Mono邮件列表。在这里,您可以与Xamarin的社区和开发人员进行交流。

8) Are there any drawbacks that I may have overlooked, that you can think of? Like is there any strange problems with directory browsing, config file hirearchy, jquery/ajax issues, etc.

有什么缺点我可能忽略了,你能想到吗?比如在目录浏览、配置文件的层次化、jquery/ajax等方面有什么奇怪的问题吗?

Case sensitivity could be an issue. Linux is a case sensitive OS so you need to make sure that all file system calls are case sensitive. Depending on which database you choose it too could be case sensitive. Postgresql is a case sensitive database so when executing queries the column names have to be case sensitive. With MVC URLs are not case sensitive so you should be fine with that. ASP.Net websites are case sensitive as the page names are using the the URLs. If you do have case sensitivity issues when first running your applications on Mono with linux then you can use Mono IOMap to get things up and running. IOMap deals with case insensitivity but it does give your application a performance hit so it is not recommended for use in a production environment.

病例敏感性可能是一个问题。Linux是区分大小写的操作系统,所以您需要确保所有文件系统调用都是区分大小写的。根据您选择的数据库,也可以区分大小写。Postgresql是一个区分大小写的数据库,所以在执行查询时,列名必须区分大小写。使用MVC url时,不区分大小写,所以应该没问题。ASP。Net网站是区分大小写的,因为页面名称使用的是url。如果您第一次使用linux在Mono上运行应用程序时确实有大小写敏感问题,那么您可以使用Mono IOMap来启动和运行应用程序。IOMap处理大小写不敏感问题,但它确实会影响应用程序的性能,因此不建议在生产环境中使用它。

9) Do you have any recommendations, tutorials, blogs, etc? Is there a Stack Exchange site that deals with these types of issues better than this one? (I couldn't find one, other than perhaps the Linux one.

你有什么推荐、教程、博客等吗?是否有一个堆栈交换站点比这个站点更好地处理这些类型的问题?(我找不到一个,也许是Linux的那个。

I can't think of any better websites for programming and server admin other than stackoverflow and serverfault.

除了stackoverflow和serverfault之外,我想不出还有什么更好的网站来进行编程和服务器管理。

10) Although it is not a necessity for me to do this, I would like to set it up and do it just to have the option in the future but I won't waste my time on it if it is a complete waste. I have both a linux VPS and Windows VPS that I rent right now, so if I did this it would also allow me to have only a Linux remote server (possibly with less hard drive space and ram) so it would potentially save me money. So my final question is, would you recommend doing this if your situation was similar to mine?

虽然这对我来说并不是必须的,但我想把它建立起来,这样做只是为了将来有选择的机会,但如果完全是浪费的话,我不会在上面浪费时间。我现在租了一个linux VPS和Windows VPS,所以如果我这样做的话,它也只允许我有一个linux远程服务器(可能只有更少的硬盘空间和ram),所以这可能会节省我的钱。我的最后一个问题是,如果你的情况和我的相似,你会建议这样做吗?

I would recommend it but you must be aware that there is a big learning curve to familiarize yourself with the Linux OSes, different database servers and installing/configuring apps to run on the Mono framework. You probably will find that a lot of things are not as intuitive as they are using the MS technologies. You won't be using a GUI deploy and configure your apps on the server as SSH is the best way to interact with Linux servers.

我建议您这样做,但您必须知道,要熟悉Linux操作系统、不同的数据库服务器以及安装/配置应用程序以在Mono框架上运行,您需要学习很多知识。您可能会发现,许多事情并不像使用MS技术那样直观。您不会在服务器上使用GUI部署和配置应用程序,因为SSH是与Linux服务器交互的最佳方式。

更多相关文章

  1. 远程连接腾讯云MySQL数据库
  2. thinkphp连接mysql数据库查询数据显示
  3. Linux系统Oracle12.2 RAC集群实施维护_Oracle数据库12cR2(项目实
  4. Linux环境下修改MySQL数据库存储引擎
  5. linux下mysql表名大小写敏感问题
  6. mysql数据库忘记ROOT密码时的解决办法
  7. 无法从SQLite数据库获取最后一行
  8. sql2008中如何收缩数据库日志文件
  9. 如何利用SQL语句查询数据库中所有表的名称?

随机推荐

  1. 利用javascript实现遍历xml文件的代码实
  2. 一个html+css+js的轮播图片 -- 仅供参考
  3. 输入自动完成或Rails中的新功能
  4. Jquery中动态添加元素的绑定事件不起作用
  5. jqGrid 数据加载完事件 loadComplete 使
  6. 对象的属性也要加引号吗
  7. 带有Bootstrap 4的导航栏中的悬停问题
  8. Moment.js:Date.now()javaScript analogue
  9. 没有'Access-Control-Allow-Origin'反应
  10. 特拉维斯CI Jest Preset反应原生未找到