Asp.net core ASP.NET核心RC1到1.0.0迁移错误
我正在尝试将我的asp.net core 1.0.0 RC1应用程序迁移到final 1.0.0,在其他帖子的帮助下,我成功地将所有引用从RC1更改为final 1.0.0 但仍然存在一些错误,我无法找到合适的替换方法或参考Asp.net core ASP.NET核心RC1到1.0.0迁移错误,asp.net-core,asp.net-core-mvc,.net-core,asp.net-core-1.0,Asp.net Core,Asp.net Core Mvc,.net Core,Asp.net Core 1.0,我正在尝试将我的asp.net core 1.0.0 RC1应用程序迁移到final 1.0.0,在其他帖子的帮助下,我成功地将所有引用从RC1更改为final 1.0.0 但仍然存在一些错误,我无法找到合适的替换方法或参考 app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear()); 错误CS1061“IApplicationBuilder”不包含“UseIISPlatformHand
app.UseIISPlatformHandler(options => options.AuthenticationDescriptions.Clear());
错误CS1061“IApplicationBuilder”不包含“UseIISPlatformHandler”的定义,并且没有扩展方法
“UseIISPlatformHandler”接受类型为的第一个参数
找不到“IApplicationBuilder”(是否缺少使用
指令或组件引用?)
我在project.json中有“Microsoft.AspNetCore.Server.IISIntegration”:“1.0.0”
services.AddEntityFramework().AddSqlServer()
.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
services.AddEntityFramework().AddSqlServer()
.AddDbContext(选项=>
使用SQLServer(配置[“数据:默认连接:连接字符串]);
错误CS1061“IServiceCollection”不包含“AddEntityFramework”的定义,也不包含扩展方法“AddEntityFramework”
无法找到接受类型为“IServiceCollection”的第一个参数
(是否缺少using指令或程序集引用?)
我在project.json中有“Microsoft.EntityFrameworkCore:”1.0.0“,”Microsoft.EntityFrameworkCore.SqlServer:”1.0.0“,
services.AddEntityFramework().AddSqlServer()
.AddDbContext<ApplicationDbContext>(options =>
options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));
谁能帮我解决这些问题?
提前感谢。第一期
删除app.UseIISPlatformHandler
行,并在如下主方法中添加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();
}
publicstaticvoidmain(字符串[]args)
{
var host=new WebHostBuilder()
.UseKestrel()
.UseContentRoot(目录.GetCurrentDirectory())
.UseIISIntegration()//替换对UseIISPlatformHandler的调用
.UseStartup()
.Build();
host.Run();
}
第二期
使用services.AddEntityFrameworkSqlServer()
而不是services.AddEntityFramework().AddSqlServer()
参考文献:
从ASP.NET 5 RC1迁移到ASP.NET Core 1.0
从ASP.NET Core RC2迁移到ASP.NET Core 1.0
看看这是否有帮助。我建议使用单个用户帐户创建一个新的web应用程序,然后将新项目与当前项目进行比较,看看有什么变化。在最新版本中,您将获得一个Program.cs文件,IIS集成将在那里进行,而不是在启动时进行