将我的 ASP .net 5 项目发布到 IIS 后,出现错误:
System.TypeLoadException:无法从程序集“Microsoft.AspNet.Http.Abstractions”加载类型“Microsoft.AspNet.Builder.RequestDelegate”
根据一些帖子,原因似乎是软件包版本不同步。我检查了我的 approot/packages 文件夹,发现当我的网站使用 rc1-final 发布时,许多包的版本 (rc2) 不正确。我删除了这些软件包,因为那里也有正确的版本,但现在我收到以下错误:
System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
at System.Reflection.RuntimeAssembly.nLoadFile(String path, Evidence evidence)
at System.Reflection.Assembly.LoadFile(String path)
如何修复我已发布的项目以解析为正确的版本?我在 project.json 中的所有引用都明确指向 rc1-final。这是我的 project.json 中的依赖部分:
"dependencies": {
"Microsoft.AspNet.Diagnostics": "1.0.0-rc1-final",
"Microsoft.AspNet.IISPlatformHandler": "1.0.0-rc1-final",
"Microsoft.AspNet.Mvc": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.Core": "6.0.0-rc1-final",
"Microsoft.AspNet.Mvc.ViewFeatures": "6.0.0-rc1-final",
"Microsoft.AspNet.Server.Kestrel": "1.0.0-rc1-final",
"Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0-rc1-final",
"Microsoft.Extensions.Logging": "1.0.0-rc1-final",
"Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final",
"Microsoft.Net.Http": "2.2.22",
"Microsoft.Extensions.Configuration": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Abstractions": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.Json": "1.0.0-rc1-final",
"Microsoft.Extensions.Configuration.FileExtensions": "1.0.0-rc1-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.Commands": "7.0.0-rc1-final",
"Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-final",
"Sendgrid": "6.1.0",
"Sendgrid.Webhooks": "1.1.0",
"Microsoft.AspNet.SignalR.Server": "3.0.0-rc1-final",
"RabbitMQ.Client": "3.5.6"
},