Rohit
Rohit

Reputation: 75

Aspnet5 Console Application not allowing me non static main

I am developing a console application in ASPNET5. I read that it allows instance based entry point (https://msdn.microsoft.com/en-us/magazine/dn913182.aspx). However when I create a new project using ASPNet5 Console Application project template, it creates public static void Main(string[] args)

Then I thought, okay I might be able to change this to non static and add dependencies in Program constructor. I tried that but it complains and says "Program does not contain a static 'Main' method suitable for an entry point".

Now question is if it doesn't allow how can I inject dependencies in entry point? I am using 1.0.0-rc1-final.

Upvotes: 2

Views: 179

Answers (1)

Pawel
Pawel

Reputation: 31610

Non-static Main is no longer supported in RC1. Take a look at this announcement for more details. You need to use PlatformServices and CompilationServices instead.

Upvotes: 3

Related Questions