I am facing a problem right now, that is, I'm currently trying to create a console application with the newer version of ASP.NET 5 (RC1, CoreCLR), the code is like this below:
using System;
public class MyTestClass {
public static void Main(string[] args) {
Console.Write("Hello StackOverflow");
}
}
When executing dnx run I get the following error:
does not contain a static 'Main' method suitable for an entry point
So far so good, i've made some research and found that the solution is: you need to have a class called 'Program' as an entry point. So to make this work my code is now:
using System;
public class Program {
public static void Main(string[] args) {
Console.Write("Hello StackOverflow");
}
}
My Final question is: Why do i have to implement a class Program as an entry point in ASP.NET 5??? If In older versions The first code works perfectly, is this some new functionality of C# 6.0?