I have created new mvc project and added startup.cs class with one method.
but debug is not coming in this method directly debug is going on homecontroller
but it should come first startup class. why my debug is not coming in configuration method.
public class Startup
{
public void Configuration()
{
}
}

Jignesh KumarRank #91 · 22.9K reputationPosted Jul 18, 2023, 12:15 AM EDT
Are you using .net 6 or which version ?
if you are using .net 6, please refer this one,
https://www.c-sharpcorner.com/article/how-to-add-startup-cs-class-in-asp-net-core-6-project/
Vahid FarahmandianRank #961 · 2.1K reputationPosted Jul 21, 2023, 7:26 AM EDT
It seems that there is something wrong with your Program.cs file. You need to specify the Startup class in this file before building the WebHost.
You can double check your Program.cs file with this article:
https://www.c-sharpcorner.com/article/what-is-startup-class-and-program-cs-in-asp-net-core/