.net core 未找到方法:';System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider';

.net core 未找到方法:';System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider';,.net-core,build-error,methodnotfound,missingmethod,.net Core,Build Error,Methodnotfound,Missingmethod,在我使用.net核心应用程序的主要方法中,我遇到了这个错误,我不知道应该在哪里寻找解决方案 这是我的主要方法: public static void Main(string[] args) { var host = new WebHostBuilder() .UseKestrel() .UseContentRoot(Directory.GetCurrentDirectory()) .UseIISIn

在我使用.net核心应用程序的主要方法中,我遇到了这个错误,我不知道应该在哪里寻找解决方案

这是我的主要方法:

 public static void Main(string[] args)
    {
        var host = new WebHostBuilder()
            .UseKestrel()
            .UseContentRoot(Directory.GetCurrentDirectory())
            .UseIISIntegration()
            .UseStartup<Startup>()
            .UseApplicationInsights()
            .Build();

        host.Run();
    }

将软件包ApplicationInsights从2.0降级到1.1.2版已解决

我刚刚使用aspnet core 2.0遇到这个问题,在我的情况下,将其他默认软件包(AspNetCore、AspNetCore.Mvc、NetCore.App)升级到2.0成功,尽管安装了2.0版软件包(除了App insights)WARE 1.1.x最初

我在使用Sql nuget和升级修复该问题时遇到了类似的问题

IDbContextFactory
必须更改为
IDesignTimeDbContextFactory

System.MissingMethodException: 'Method not found: 'System.IServiceProvider Microsoft.Extensions.DependencyInjection.ServiceCollectionContainerBuilderExtensions.BuildServiceProvider(Microsoft.Extensions.DependencyInjection.IServiceCollection)'.'