You need to add a static class that has a static Main method. From there you must take it. As below:
public class Program { public static void Main(string[] args) { var configuration = WebApplicationConfiguration.GetDefault(args); var application = new WebApplicationBuilder() .UseApplicationBasePath(Directory.GetCurrentDirectory()) .UseConfiguration(configuration) .UseStartup<Startup>() .Build(); application.Run(); } }
Not sure if necessary, but you might need the following in project.json :
"compilationOptions": { "emitEntryPoint": true }
In the full version:
{ "version": "1.0.0", "compilationOptions": { "emitEntryPoint": true }, "dependencies": { "Microsoft.AspNet.Server.Kestrel": "1.0.0-rc2-*", "Microsoft.AspNet.Hosting": "1.0.0-rc2-*" }, "frameworks": { "dnx451": {}, "dnxcore50": {} } }
source share