当我尝试使用以下内容时:
app.RunIISPipeline();
Visual Studio建议我添加"Microsoft.AspNet.Loader.IIS": "1.0.0-beta8-15609"
。如果我将其添加到我的project.json文件中,则会出现以下错误:
“IApplicationBuilder”类型是在未引用的程序集中定义的。您必须添加对程序集'Microsoft.AspNet.Http.Abstractions,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null'的引用...
如果我然后将"Microsoft.AspNet.Http.Abstractions": "1.0.0-rc1-final"
添加到我的project.json文件中。我仍然收到同样的错误。
我错过了什么?
修改
此代码段来自ASP.net 5 documentation.
// Enable the IIS native module to run after the ASP.NET middleware components.
// This call should be placed at the end of your Startup.Configure method so that
// it doesn't interfere with other middleware functionality.
app.RunIISPipeline();
答案 0 :(得分:1)
由于设计更改,ASP.NET Core应用程序不再支持该API。您可以查看GitHub repo aspnet / Hosting问题,
https://github.com/aspnet/Hosting/issues/323