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()
{
}
}
Vahid FarahmandianPosted Jul 21, 2023, 11:26 AM
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/
Jignesh KumarPosted Jul 18, 2023, 4:15 AM
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/