简体   繁体   中英

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.

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.

I found that my team used to have dll's in the bin folder but wasn't checked in, but the project file still had references pointing to those deleted dll's. What happened was I still had those dll's in my bin while nobody else did, and those dll's depended on microsoft.web.infrastructure existing, so I was the only one getting that error.

For me, those dll's (references) were:
System.Web.Razor System.Web.WebPages System.Web.WebPages.Deployment System.Web.WebPages.Razor

So instead of modifying references in the the project file (It'll be on a different check in), I just deleted those dll's in my bin, and no more dependencies on microsoft.web.infrastructure .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM