migrating asp.net core 1.0 to 2.0

To migrate, you need code change

Code change

Net Core 1.0

            var host = new WebHostBuilder()

Net Core 2.0


        public static IWebHost BuildWebHost(string[] args)
       => WebHost.CreateDefaultBuilder(args).CaptureStartupErrors(true)

Nuget packages update 

We need to upgrade all the nuget packages - which include Application.Insights, Microsoft.AspNetCore and EntityFramework. 

Window Hosting Bundle

Install Windows Hosting Bundle 2.0 and above.

Potential Error that you might see are :-

Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider'

The library hostpolicy.dll was not found  - This has to do with your application compile and targeted for 2.0 but does not have the runtime configure on the server side (IIS) 

Code still in 1.0 instead of 2.0  - you might get error "Process cannot be started" when trying to run on server with .net 2.0 runtime installed. 


Popular posts from this blog

PySpark - Working with JDBC Sqlite database