0

I have created an ASP.NET Core WebApi project. Trying to add Integration Test Project following Integration tests in ASP.NET Core article. According to the sample project, I have added another web application for the Test project and configured like the sample project. Then I deleted the program.cs and startup.cs files. But when I build the project got the following error:

Error CS5001 Program does not contain a static 'Main' method suitable for an entry point

My folder structure is like this: enter image description here

Alamgir
  • 686
  • 8
  • 14
  • See this [thread](https://stackoverflow.com/questions/41156691/asp-net-core-program-does-not-contain-a-static-main-method-suitable-for-an-en) may helpful. – Yinqiu Dec 31 '20 at 01:59
  • If I put Output Type as class Class Library, this works fine but the sample project's output type is Console Application. How the do that? – Alamgir Dec 31 '20 at 05:32
  • How about change to `"buildOptions": { "emitEntryPoint": false },` – Yinqiu Dec 31 '20 at 05:37
  • Or add `public static void Main(string[] args) => WebApplication.Run(args);`to your startup. – Yinqiu Dec 31 '20 at 05:39

0 Answers0