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

Noorann Tech 0 Reputation points
2024-02-27T11:49:12.7533333+00:00

I developed ASP.NET website for five years. Recently I upgraded to VS2022 recent release, then R-Click on the project name in Solution Explorer I ran "Analyze and Code Cleanup". Now, I get a build error "CS5001: Program does not contain a static 'Main' method suitable for an entry point" Also, I do not see an option to set the project StartPage? How can fix this?

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,273 questions
Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
4,628 questions
Visual Studio Debugging
Visual Studio Debugging
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Debugging: The act or process of detecting, locating, and correcting logical or syntactical errors in a program or malfunctions in hardware. In hardware contexts, the term troubleshoot is the term more frequently used, especially if the problem is major.
945 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Noorann Tech 0 Reputation points
    2024-02-27T13:44:08.76+00:00

    Reverting the last change (large size change) will be my last resort. Switching to Class Library eliminated the build error but introduced a debug error: "The 'RunCommand' property is not defined." The program does not start. What should I try next? Thanks!!!