Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft.web.Infrastructure.dll not found - Visual studio 2015

I have this dll (Microsoft.web.Infrastructure.dll) in many project's package.config of my solution. There are no build errors and the dll is getting downloaded to Solution's packages folder. I am getting runtime error on missing dll on each of the project the application hits. When I look at the individual project bin folder, I don't see this dll copied. However as I mentioned earlier the dll is downloaded to packages folder of solution.

Temporary Solution -

  1. Manually copy this dll to all individual project bin
  2. Place this dll in GAC

This problem is only on my machine and not on any other colleague's machine. Surprisingly some of them have this dll copied into project folder while some of them don't. It works for them without this dll in GAC and without any manual effort, a clean rebuild did everything for them.

I have a short term fix but I am more curious to know how it working on other machines and what I am missing.

Things that I have tried so far - Clean Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root.... Clean solution and close reopen solution and finally Rebuild solution

Visual studio 2015 doesn't have clear nuget cache as compared to visual studio 2013.

FYI - I have Visual Studio 2015 and all other machines are on 2013, if not something else this is where I am looking at now.

Any help is appreciated.

like image 591
Raj Avatar asked Jan 18 '17 18:01

Raj


1 Answers

Please check whether the Microsoft.web.Infrastructure.dll is exist in the Project References. If not, please try Win’s suggestion to reinstall your package in the Package Manager Console by following command:

Update-Package –reinstall Microsoft.Web.Infrastructure

Because the NuGet Restore only restores packages based on the package.config file to the packages directory, but does not add the reference to your project by default. So we need to force reinstall the package to add references and content files into project.

If the dll is already existed in your Project References, you need to check the property value of “Copy Local”. The Copy Local property determines whether a reference is copied to the local bin path. The CopyLocal=True should be set if the reference want to be copied to bin folder. See Set the Copy Local Property for more detail.

like image 115
Weiwei Avatar answered Nov 12 '22 06:11

Weiwei