How to deploy a self contained .NET Core app.

by Mahmut Jomaa on June 27, 2016
Ok this blog post is rather a duplicate of the docs. However many people wrote me an e-mail because they simply didn't find it.   Docs:   1. Change the…

.NET Core 1.0 got released

in News
by Mahmut Jomaa on June 27, 2016
Today is the day. Microsoft announced something sweet at Red Hat DevNation. After a 3 year long journey .NET Core 1.0 got released:     1. Get the Visual…

Microsoft aquired Xamarin

in News
by Mahmut Jomaa on February 25, 2016
Microsoft announced today that they aquired Xamarin. This is HUGE!   About Xamarin Xamarin is a provider for mobile app development technology. You can write a C# application and cross-compile…

Building a simple Brainfuck Interpreter in C

in C/C++
by Mahmut Jomaa on December 08, 2015
Brainfuck is a Turing-complete language that isn't necessary designed for productive usage :) However it is actually great to understand C pointers. An Interpreter is a computer program that directly…

How to enable precompiled razor views (.cshtml) in ASP.NET 5

by Mahmut Jomaa on November 29, 2015
If you want your .cshtml to be precompiled before the first request hits, you need to enable it manually. This increases time needed for compilation, however the compilation process still…

Upgrading your ASP.NET 5 application from beta8 to RC1

by Mahmut Jomaa on November 23, 2015
There aren't that many API changes, the focus on RC1 was to stabilize the code base.   Installation of RC1: 1. First download and install the RC1 upgrade for Visual…

in Projects
by Mahmut Jomaa on November 09, 2015
Today I'm releasing a new online tool: In short: You can store text online or use it as your syntax highlghter (for your blog).   Features: Paste and share…

ASP.NET 5 Console Application

Yep, that's right! ASP.NET 5 is not only for web, but supports Console Applications

Strictly speaking, it is a simple Console Application that runs as a NuGet package in the new ASP.NET 5 world and thereby also could include the benefits of a .NET Core project:

  • Cross Platform
  • Cloud and IoT optimized
  • No Overhead
  • Modularization (project.json)

Many people get confused at this point so let's light it a bit up.


1. First let's create a new Console Application:

Note: It's located under "Web"


2. Now Let's write some code, how about Fibonacci:

Note: The context is not static (public void Main)

using System;
namespace ConsoleApp1
    public class Program
        public void Main(string[] args)
            Console.WriteLine("Fibonacci on ASP.NET 5:");
            for (int i = 0; i < 15; i++)
            // keep console open
        public int Fibonacci(int n)
            int a = 0;
            int b = 1;
            for (int i = 0; i < n; i++)
                int temp = a;
                a = b;
                b = temp + b;
            return a;


3. Optional: Select  .NET Core:


4. Run and voila!


You can use this kind of Console Application under Windows, Linux and MacOS. It's well suited to handle backgound tasks, especially for IoT and in the cloud.

I'm using it together with to do some database commands aswell as fetching/updating data into my database for my Online Youtube Converter.





1. If you want to run this through command line, have a look into your project.json:


2. Now start the application via dnx:

dnx . ConsoleApp1

Mahmut Jomaa is a Software Engineer from Germany.

Currently he attends university to gain more knowledge in Computer Science.

Security code Refresh


Because insights are awesome!