Deploying ASP.NET Core Applications on Apcera

Historically, most .NET applications have run on Windows. In fact, many people are still surprised to hear that some .NET applications can run on Linux. But that has actually been the case since 2004 when the open source project Mono 1.0 was released. Since 2014, .NET developers can also deploy some .NET applications to Linux using the .NET Core and ASP.NET Core frameworks. ASP.NET Core unites the previously separate ASP.NET MVC and Web API frameworks into a single programming model; it can run on both .NET Core and on the full .NET Framework.

Apcera was recently asked by a customer if they could run their ASP.NET Core applications on .NET Core on the Apcera Platform. Since these frameworks do support Linux, we knew that running them on Apcera was possible, but we had not actually done it before. But here at Apcera we don't shy away from challenges.

So, I started reading about .NET Core and ASP.NET Core, installed them on my Mac, and created a sample ASP.NET Core MVC application.  I knew that deploying this and other .NET Core applications to Apcera would require two things: a .NET runtime package containing the .NET SDK and Runtime and a custom .NET stager.  The .NET runtime package would be combined with a Linux OS package and the application itself in a container running on and managed by Apcera. The .NET stager would be used to actually deploy the application to Apcera and make sure it used the .NET runtime package.

Fortunately, creating the .NET runtime package and .NET stager only took a few days. After I tested that I could deploy both ASP.NET Core source code and published DLLs with them, I shared them with the customer. He confirmed the next day that he was also able to deploy and run his own (much more complex) ASP.NET Core application on .NET Core on Apcera.

Challenge solved! Customer happy!

asp.net-core-app-on-apcera

You can download the .NET runtime package and .NET stager from the example-dotnet directory of the Apcera sample-apps GitHub repository which includes extensive documentation on how to use them along with a sample ASP.NET Core application. If you're running .NET applications on Mono, see the example-mono project instead which was previously created by my colleague, Jamie Smith.

Please note that the .NET Framework only supports Windows. So, you can only run ASP.NET Core applications on Apcera if you use .NET Core.

Here is a video showing how easy it is to deploy an ASP.NET Core application to Apcera: