Porting .NET Core 2.x app to .NET Core 3.1

During the past week I needed to upgrade a small project based on .NET Core 2.x to the new .NET Core 3.1. I need to say that the overall process was not completely painless but in less than 1 hour I could compile and publish on Azure my solution.

I had to do some changes in order to configure the logging in my Startup class and for this reason I needed to change the class Program as follow:

public class Program
{
     public static void Main(string[] args)
     {
          BuildWebHost(args).Run();
     }

     public static IWebHost BuildWebHost(string[] args=>
          WebHost.CreateDefaultBuilder(args)
               .UseStartup<Startup>()
               .ConfigureLogging(logging =>
     {
          logging.ClearProviders();
          logging.AddConsole();
     })
     .Build();
}

It’s not a big deal anyway 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: