0

Hello I'm getting a problem not getting hit into Program.cs . We converted this project from previous .NET core . Now we are using latest .NET core 5 web api . I think when the first application run this project debug mode should go to Program.cs Main Function but it is not going . Here is my code of Program.cs :

       public static async Task Main(string[] args)
         {

        Utility.Log.Init("Webdamad");
        Utility.Log.I("Test");

        platform.Check();

        await LoadMasterAsync().ConfigureAwait(false);

        Models.MyModelName.Init();
        Models.MySecondModel.Init();

        CreateHostBuilder(args).Build().Run();

        Utility.Log.I("Init End");
        }

Here Is Create HostBuilder

     public static IHostBuilder CreateHostBuilder(string[] args) =>
        Host.CreateDefaultBuilder(args)
            .ConfigureWebHostDefaults(webBuilder =>
            {
                webBuilder.UseUrls($"http://*:{platform.port}");
                webBuilder.UseStartup<Startup>();
            });

I think I have some route Problem and From Where should I Check . Thanks in advance . Every Project when The Project run should go to Main Function but here it is not going .

2
  • Do you perhaps have two Main methods? You say it doesn't enter this one, so what happens instead? Commented May 22, 2021 at 9:48
  • Sorry I have One . I checked Commented May 24, 2021 at 0:21

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.