ASP.NET 核心 RC1 到 1.0.0 迁移错误

ASP.NET core RC1 to 1.0.0 migration errors

我正在尝试将我的 asp.net 核心 1.0.0 RC1 应用程序迁移到 final 1.0.0,在其他帖子的帮助下,我设法将所有引用从 RC1 更改为 final 1.0.0 但是仍然有一些错误,我找不到合适的替换方法或参考资料

app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());

Error CS1061 'IApplicationBuilder' does not contain a definition for 'UseIISPlatformHandler' and no extension method 'UseIISPlatformHandler' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)

我有 "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0" project.json

services.AddEntityFramework().AddSqlServer()
.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));

Error CS1061 'IServiceCollection' does not contain a definition for 'AddEntityFramework' and no extension method 'AddEntityFramework' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)

我有 "Microsoft.EntityFrameworkCore": "1.0.0", "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0", project.json

谁能帮我解决这些问题? 提前致谢。

第一期,

删除 app.UseIISPlatformHandler 行并在 Main 方法中添加 UseIISIntegration() 如下所示-

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


            host.Run();
        }

第二期,

使用services.AddEntityFrameworkSqlServer()代替services.AddEntityFramework().AddSqlServer()

参考文献:

从 ASP.NET 5 RC1 迁移到 ASP.NET Core 1.0 https://docs.asp.net/en/latest/migration/rc1-to-rtm.html

从 ASP.NET Core RC2 迁移到 ASP.NET Core 1.0 https://docs.asp.net/en/latest/migration/rc2-to-rtm.html

看看这是否有帮助。