C # Development Guide for Linux

Source: Internet
Author: User

I Caishuxueqian, write down this guide by documenting my own experience with C # Linux development. (Advice for friends who want to develop C # programs on Linux)

Websites currently running on Linux: http://douxiubar.com | A work of Http://douxiubar.com/AdminLogin/Index (MVC4+DAPPER+AUTOFAC)

On the Linux development proposal http://www.linuxdot.net/and http://jexus.org/discussion study, I just contact that will know oneself Caishuxueqian, benefit a lot (entry question; What is the length of IntPtr in 64 bits?) Hey

Guide one: First face the Linux and win some of the differences, that is, some common sense, win file naming is not case-sensitive, and Linux is case-sensitive, so when creating a file to pay attention to case

Guide two: The system directory separator, you can call Path.directoryseparatorchar to achieve multi-platform compatibility, another recommended to do the path operation more use System.IO.Path, instead of splicing

Guide three: different line characters , win \r\n,linux \ n, can call Environment.NewLine to do compatibility, rather than their own silly write line break, also suggest to see system.environment this class

Guide four: When you want to develop a program, both in the Linux run normally, and can run win, pay attention to the DLL you call to go API is not compatible (for example, some DLLs call the Win32 API directly, you will not be supported on the Linux call).

Guide five: The C # language itself is free, cross-platform , it is after the compilation is IL, so you use vs development of C #, can be run directly on Linux (the actual hosting runtime is the key), a Hello World can run across the river (WIN,LINUX,MAC).

Guide Six: If you want to develop debugging on Linux, Xamarin Studio is in your appetite (address: Http://www.monodevelop.com/Xamarin Studio, formerly known as MonoDevelop, The predecessor of MonoDevelop is SharpDevelop, can be said to have a long history), the use of gtk# can be developed in the Linux desktop program, now the latest version, can support the latest C # compiler.

Guide VII: About creating a project package, vs comes with a template many configurations (such as Web. config) and DLLs, are biased towards win, even if it is an empty project, there will be errors on Linux (running Jexus Web server), This is the time to clean up the referenced DLLs and the configuration within Web. config, removing the unused stuff. (This time a lot of basic poor foundation has been confused, usually in win development, completely did not pay attention to the main points, exposing their own foundation )

Guide VIII: Recommend the development of the project when the use of conditional development, the need to call the platform features, there are targeted for conditional compilation, which can make the project more robust!

Guide nine: Linux on the development of C # is not very difficult, in fact, or simple, as long as you will play, will see, will solve the error ( understand and solve the hundreds of exception, manto be careful, so you are not far away from the great God)!

Guideline Ten: Recommended Learning Blogs: http://www.cnblogs.com/xiaodiejinghong/,http://www.cnblogs.com/yunei/

Guide 11: Do not ask Linux development mature immature, Jexus's author in C # developed on Linux for many years. Do not ask Jexus performance, you actually get two identical configuration of the computer, a run Linux+jexus+mono, another run Win+iis+.net FrameWork, with Apache AB tool pressure measurement can know (I'm afraid I said Jexus performance is good, You do not believe), all speak with the actual data!

Guide 12: Jexus is free, but not open source (want to source code can be and the author's business consulting, and sometimes even give you a person, you do not understand ... But you don't have to worry about anything, there are bugs and suggestions that can tell the author that the normal Web server has features that it has. With Jeuxs not only ASP. NET Web server, used to run Php,java can also!

At present my Cactus project is running well on Linux (of course can also run win system) attached to the project description address: http://www.cnblogs.com/RainbowInTheSky/p/5212002.html

C # Development Guide for Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.