最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

ASP.NET Web API on .NET 4.8 - can't load assembly - Stack Overflow

programmeradmin10浏览0评论

I have a .NET 4.8 (migrated from .NET 4.5.2) ASP.NET Web API that I have deployed to a dev server and it is working fine.

I take the same code and deploy it to a qa server, and I am getting the following error when I call it:

Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Both servers have .NET 4.8 installed.

The web.config has the following redirection:

<dependentAssembly>
    <assemblyIdentity name="Microsoft.Web.Infrastructure" publicKeyToken="31bf3856ad364e35" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
</dependentAssembly>

I look in the bin folder and Microsoft.Web.Infrastructure.dll exists, and when I check its properties, the version is v2.0.34876.0

I don't see why it is looking for v1 instead of v2, and why it would work on one server but not another.

发布评论

评论列表(0)

  1. 暂无评论