Is Mono a .Net port? - c#

Is Mono a .Net framework port to Linux, or is more fair to view it as just another Linux framework that happens to use C# which is an open standard?
I never hear hear of wide spread Mono adaption
Thanks

Mono is definitely NOT a port (which would mean that Microsoft gave
the code and that it has been tweaked to run on Linux and other
platforms). Mono is an independent reimplementation of the .Net
framework (and a few other features and innovations on top of it)
Mono is an open source implementation of Microsoft's .NET Framework based on the ECMA standards for C# and the Common Language Runtime. Mono can be used to make .net applications work in linux even though there will be some performance degradation and some other difficulties. Any way you can have the basic functionality. Currently, Mono supports just about everything available in .Net 2.0. There are a few notable exceptions, like Windows.Forms' DataGridView and ASP.Net's WebParts. There are also a couple of namespaces that don't really have a Linux equivalent like EnterpriseServices, System.Management, and System.Messaging.
The stated purpose of Mono is not only to be able to run Microsoft .NET applications cross-platform, but also to bring better development tools to Linux developers. Mono can be run on Android, BSD, iOS, Linux, Mac OS X, Windows, Solaris, and Unix operating systems as well as some game console operating systems such as the ones for the PlayStation 3, Wii, and Xbox 360.
http://www.mono-project.com/Mono_For_.Net_Developers
http://www.mono-project.com/Main_Page
http://en.wikipedia.org/wiki/Mono_(software)

Related

minimum requirement for a mono project to execute in different platforms

I'm developing a desktop application with C# (.net 2.0 framework), I will compile it with Mono develop in windows and will change the GUI to GTK#,
What is the minimum requirement of frameworks must present in different platforms to execute this application.
In windows it is .Net 2.0 ,
what it is in linux , ubuntu centos etc...,
what it is in mac..?
Also it will be helpful to know the default version of framework existing in each platform.
Please send some helpful url or references.
Mono usually supports the same runtime version for all plattforms; that means if you target and develop against the .NET35 profile on say OS X, your Application will also run on Linux (and of course windows) with mono on that profile. Same holds true for the .NET 2.0 and 4.0 profiles. The .NET 2.0 is the one most complete and stable, but to my experience the .NET35 and .NET4 profiles are very usable, too; lot of .NET35 libraries compiled for Windows will just run out of the box on Linux and OS X if you use mono.
A word of warning: I've worked with Gtk (not restricted to Gtk#) on OS X and must say, you should avoid it. The gtk-quartz branch is not nearly as stable as its linux counterpart. There are several known issues that will reproducibly crash your application (i.e. there are issues with Drag'n'Drop), and some pieces are missing completely. Only using the X11 backend with gtk on OSX will yield satisfying results, but provide a very poor integration into the OS and user experience.
You might want to consider developing different GUI frontends for each OS: Gtk# on Linux, WPF on Windows, Cocoa via MonoMac, or take a look at the in-development Xwt framework.

MonoDevelop for .NET application on Linux

I need to develop C# applications, but i use Linux (ubuntu), I found MonoDevelop, but I don't understand if i can write .NET applications from Linux to use on Windows, so the development on linux and the execution on Windows. are them compatible?
On the Mono website I found:
Mono is a software platform designed to allow developers to easily
create cross platform applications.
What does it means? Can I write on Linux c# applications that can run wherever the .NET framework is installed?
Thank you for the clarification
Any C# code you compile from MonoDevelop or anywhere else can be run on any platform with either Mono or the .NET Framework. As long as the linux system has Mono installed, it can run any compiled C# application, including .exe's copied from a Windows machine.
The reason for this is that when you compile a C# application, it's not being compiled to native system code, it's being compiled to CIL. When you run the program, it automatically JIT compiles your code for the system it's running on, leaving the original executable intact. Both the .NET Framework on Windows and Mono on everything else can read and compile the CIL bytecode.
And one thing to keep in mind, Mono doesn't have the entire .NET Framework stack available. Almost all of the BCL is intact, but libraries like WPF are not available on Mono. Mono recommends you use GTK# for your GUIs.
Yes, you can use mono to create .NET applications that will run on Linux, Windows and Macs.
Mono is:
It is an open source implementation of Microsoft's .Net Framework based on the ECMA standards for C# and the Common Language Runtime.
This means that so long as you don't write code that is platform specific, you can run it on all platforms that .NET can run on. (So, instead of concatenating paths using \ or / you use Path.Combine, and instead of hardcoding linebreaks as \n you use Environment.NewLine and such).
Another advantage is that the mono development tools are free. (see: http://www.mono-project.com/Main_Page)
You can indeed write .NET code in Mono on Linux and run the application on Windows, Mac OS X and Linux.
But keep in mind that the full .NET stack is not available for you. Most noticeable is the complete lack of WPF support.
You can as long as you are careful to not assume anything about things like file system layout and use libraries that are also portable. Graphical interfaces in particular are problematic: Windows.Forms looks alien on Linux, and Gtk may feel a little out of place on Windows.

Can I build a .net solution file for Mac Computer

I am not sure that I am asking right question. But I have a suspicion that I can build a .net solution file for a mac computer. Please let me know if I can. Also the pros and cons.
Thanks
Mono is probably your best bet for working with .NET on non-Windows platforms.
Pros
Great support for the majority of .NET functionality
Ability to build and run .NET apps on non-windows platforms
Cons
Tooling is different (better or worse in different cases) than the Microsoft tools (e.g. MonoDevelop vs. Visual Studio)
Mono is one option, but depending on what parts of the .NET framework you need Silverlight might be an option as well. Mono is an open source project, which always has to chase Microsoft from behind, while Silverlight for Mac is a Microsoft release.
If you can live with the limitations of Silverlight, I'd definitely choose it instead of Mono. If you go the Mono way, be sure to test your application with Mono early and often, as there are incompatibilities.
You can use Mono on the Mac:
Mono has supported MacOS X since
version 10.3 (Panther) and supports
both Intel and PowerPC based versions
with both 32 bits and 64 bits
configuration supported.
You can use Mono on OSX to build
server, console and GUI applications.
Read below for the options available
for GUI application development.
Yes. It's called Mono. http://www.mono-project.com/Main_Page

Deploying c# app - user need to install .net framework?

Hey guys - I just wrote an app using c# and ready to deploy it. Never deployed a c# app before.
I deployed it and VC# outputted a .application file, application folder, and an installer. One of my users ran the installer (Windows 7) and was prompted to download/install the .net framework - which took upwards of 10 minutes. This is not acceptable for how simple my app is.
Moreover, I will need this app to be able to run on mac osx and linux if possible. Should I have wrote this in Java instead (poor planning on my part). What are my options?
C# is compiled to bytecode that runs on the CLR, the virtual machine that's at the core of the .NET framework. So yes, you need the .NET framework to run that.
Most current versions of Windows (XP, Vista, 7, etc.) come with some version of the .NET framework pre-installed, so your users don't have to download and install it. However, you might have used a version that's not already installed on the computers of (some of) your users.
For Linux and Mac OS X there is Mono, which is an open source implementation of .NET, but it does not contain everything that Microsoft's .NET contains, so your program might not work fully on Mono.
Using Java is not a real solution in the sense that your users would need to download and install the JRE (Java Runtime Environment) to run Java programs, very similar to the .NET framework. An advantage if you'd have used Java, is that Java is much more cross-platform compatible than .NET (Microsoft has no real interest in making .NET run on anything else than Windows).
.NET apps require the .NET framework. Java apps require the JRE. Your app is simple because .NET has done a lot of the work for you. A lot of companies write desktop apps in C++, but you will have to be mindful of cross-platform issues.
Yes, with any language that compiles to run on a managed runtime (.NET or Mono CLR, Java JVM) you will need to have that runtime installed. A C# application can compile to run on Windows on the .NET CLR, or on all the platforms you mention to run on the Mono runtime instead. Alternatively, a Java application would compile to run on the Java JRE, which is also compatible with all the platforms you mention.
So with either language there is potentially this extra installation overhead, and with either language you can achieve what you want.
You'll need to have .NET installed on your client's system in order to use your application.
As for running cross-platform - depending on how your Application is written, this can be simple or difficult.
You may want to look at Silverlight. This is directly supported on OS X and works on Linux via Moonlight.
Another alternative is to use Mono to run your .NET application on other platforms.
A C# app will need an implementation of the CLR (.NET) running on the local machine in order to run. A Java app will need an implementation of the JVM so it is really no different. On Windows, I would expect most people to have a .NET install.
Take a look at the Mono project as far as running it on Linux and Mac:
http://mono-project.com/Main_Page
One thing you can consider is using an older version of the .NET framework to ensure that the greatest number of people have it installed. I would use .NET 3.5 or even 2.0 if you do not need fancy new features. That would have been installed already on Windows 7 for example.
Since the Windows 7 user had to download the framework I assume you are currently targeting .NET 4 which means you must be using Visual Studio 2010 (or an express version). Here is a link that tells you how to target a different version of the framework:
http://msdn.microsoft.com/en-us/library/bb398202.aspx
One quick note about Mono, it is an excellent cross-platform option but it does not support the Windows Presentation Foundation (WPF) GUI framework at this point. You will either have to use Windows Forms or create different front-ends for different platforms.
If you want to create a Linux GUI (also available on Windows and Mac) you can try GTK#:
http://www.mono-project.com/GtkSharp
For a Mac native GUI you can check out MonoMac:
http://mjhutchinson.com/journal/2010/06/09/monomac_in_monodevelop
An excellent IDE for cross-platform .NET development is MonoDevelop (it will read your VC# project files):
http://monodevelop.com/
Like Java, .Net languages need a runtime installed. The full .Net framework is sometimes too big for small applications, so there is a smaller version of it call the compact framework with a smaller footprint that will install and download faster. You can read about it at http://msdn.microsoft.com/en-us/netframework/aa497273.aspx. As noted by other answers most current versions of Windows come with various versions of .Net framework, so this installation may not be needed for every user.
As far as your cross platform needs go Mono allows for running .Net applications on Linux, I am not sure about running them on OSX. My assumption is you can not. Unfortunately your cross platform requirements made .Net a bad choice, and you should have gone with Java.
Other people gave you complicated answers. Well here's my simple answer. .NET framework is needed to run .NET applications and so do Java need JVM (as MCain said). Starting with Windows Vista, Microsoft includes .NET Framework built inside Windows. And in addition, .NET have versions, from 1.0 to 4.0. With Vista and Windows 7, .NET 3.5 is installed by default. I think your app is targeted for .NET 4.0 which is why a Windows 7 user needed to install .NET framework. For me, if I have to write a simple program, I'll use .NET 2.0 (later version = larger libraries, etc) so that my users (if they are Vista or Windows 7) don't have to install .NET again to run my software. You can choose which version of .NET you will target from New Project Window in Visual Studio.
You can change the target framework in the properties tab. If you start a project in VS2008 the default is .net 3.5 and for VS2010 it is .net 4.0. If you don't need the advanced features you can change your target back to 2.0 which should be available on most computers by now (I would guess far over 90%). Be sure to remove dependencies which are not available in 2.0 (like System.Linq, System.DataSet.Extensions) and the accociated imports (But the compiler will tell you what to do).

How to run C# project under Linux

Do you know any ways to run a C# project under Linux. Are there any framewoks or libraries for this?
You're looking for the Mono Project - a cross-platform (but primarily targeted at Linux) implementation of the .NET Framework and CLR. It's capable of running binaries compiled for the CLR (MS .NET), or of creating its own native Linux binaries.
The project has been going a while now, and it's current version (2.4) is very usable, even for production purposes. See the project roadmap for details of the main features and milestones of current and future releases.
Details about the current state:
The great majority of the BCL (Base Class Library) is available on Mono, with the exception of some of the .NET 3.0/3.5 stuff, such as WPF (which has minimal support currently) and WCF (almost non-existent support). Silverlight 2.0 is however being supported via the Moonlight project, and progress on that is going well. WinForms functionality (which uses GTK# as a backend) is however quite complete, as far as I know.
Implementation of the C# 3.0 language is effectively complete, including the C# 3.0 features such as lambda expressions, LINQ, and automatic properties. I believe the C# compiler is mature to the point that its efficiency is at least comparable with that of the MS compiler, though not yet matching it in some respects. What's quite cool (and unique) about the Mono C# compiler is that is now offers a compiler service - in other words true dynamic compilation from code (without using the CodeDOM). This is something that MS will perhaps only add in .NET 5.0.
Like others have already said, you can run .NET applications on Mono. If your applications use Platform Invocation (P/Invoke) to call native code, you may run into some trouble if there is no Mono implementation of the native library. To check whether your application does that (or uses APIs that haven't been implemented in Mono yet), you can use the Mono Migration Analyzer (MoMA).
For those who come across this question post 2016, can use .NET Core - An open-source, general-purpose development platform maintained by Microsoft and the .NET community on GitHub. It's cross-platform (supporting Windows, macOS, and Linux) and can be used to build device, cloud, and IoT applications.

Categories