ASP.NET Cross-Platform Solutions

2015-08-11


ASP.NET applications mainly focused on Windows platform with using IIS web server which installed on Windows platform; However, we want ASP.NET applications to support different platforms such as Windows, Linux and Mac OSX.

We known Mono project already, Mono is the most popular solution which supports ASP.NET application to run Linux and OSX. However, Technology is changing time by time. Let us find more solutions here.

1: Mono:

So the first and popular ASP.NET cross-platform solution is Mono, which is sponsored by Xamarin.

Mono is might be a good solution for Windows Forms .NET application which belongs to local application. But for the web, we get the limitation info from Mono official website:

Mono has an implementation of ASP.NET 2.0, ASP.NET MVC and ASP.NET AJAX.

image

Mono ONLY supports ASP.NET 2.0, which is too old .NET Framework version. Most of ASP.NET applications are using at least ASP.NET 3.5+, the newest ASP.NET is ASP.NET 5. For our own cases, Our existing ASP.NET applications are mostly using ASP.NET 4.x.

So, actually Mono solution does not make sense to an ASP.NET application since our existing ASP.NET applications are using newer .NET technologies.

2: Docker:

Docker is an open platform for building, shipping and running distributed applications with making it easier to run applications in sandboxed application containers on Linux.

Though Microsoft is working on their Windows Server platform to support Docket, they also released an ASP.NET 5 preview Docker image to support other OS such as Linux, everybody can download it and run the Docker images on a Linux system.

image

Using the ASP.NET 5 Docker image, you can run your ASP.NET 5 applications on a Linux without any other .NET things installations or settings.

Please check this guide to using ASP.NET 5 Docker to run ASP.NET application on Linux.

The Docker solution seems mostly on Linux, about Mac OSX, I only found an article here. I never tried an ASP.NET 5 Docker solutions on Mac, you can try yourselves.

3: DNX:

This can be called as ASP.NET native solution.

We just posted what DNX is. So the DNX solution is a ASP.NET cross-platform solution without Docker. The cross-platform supporting came from ASP.NET itself, from Microsoft development.

DNX can be compared with Mono project, or Java Virtual Machine stuff. All different platforms can install DNX, which will provide environment for an ASP.NET 5 application running.

The DNX solution for cross-platform supporting is an eventual solution, ASP.NET support cross-platform itself, without install any other 3rd party software or packages.

Check here for getting started with ASP.NET 5 and DNX.

The DNX is an open source which can be found on Github here.

The DNX will come with ASP.NET 5 together. By now the ASP.NET 5 is still on its preview version, and current released ASP.NET 5 has not involved cross-platform feature yet. but due to ASP.NET 5 schedule and roadmap, the cross-platform supporting will be available on this month (Aug 24, 2015)

image

So maybe at the end of this month, we will have a related blog post with DNX cross-platform feature.