[ASP.NET] Error “Could not load file or assembly ‘Microsoft.Web.Infrastructure’” after deploying on Windows AzureAugust 12th, 2014 | Posted by in .NET | Article | ASP.NET | Azure | Read: 27,275
As I’m working on a small ASP.NET MVC 5 application, I wanted to deploy it on Windows Azure to test it. Thanks to Visual Studio, the deployment was really easy but, as soon as I tried to browse the website, I received the following error message:
Could not load file or assembly ‘Microsoft.Web.Infrastructure, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31bf3856ad364e35′ or one of its dependencies. The system cannot find the file specified.
After searching a bit, it appears that the error is due to the reference Microsoft.Web.Infrastructure.dll that is not deployed automatically with your app. To resolve the issue, just select the reference, go to the properties and set “Copy Local” to true:
Once this is done, deploy your website again and now, it should works fine!