Link to home
Start Free TrialLog in
Avatar of Andy Green
Andy GreenFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Could not load file or assembly 'Microsoft.Web.Infrastructure

Hi

We have a web site that we have just converted to a web app, so we can use TFS (Git) source control and have automated builds from TFS.

The code from TFS builds and runs OK on the production server, and it runs OK on my colleagues dev machine - it was he that did this work.

If I take a branch from the server and run, it downloads all the missing Nuget packages OK, but the website errors with:

Could not load file or assembly 'Microsoft.Web.Infrastructure

I'm using IIS.

Lower down in the stack trace we also have :

The pre-application start initialization method Start on type System.Web.Optimization.PreApplicationStartCode threw an exception with the following error message: Could not load file or assembly 'Microsoft.Web.Infrastructure.

Neither of us can see any reason why, we have compared installs, and version and paths.

Has anyone see the like before.

Andy
ASKER CERTIFIED SOLUTION
Avatar of Dan McFadden
Dan McFadden
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Andy Green

ASKER

Thanks Dan

I have got this working as you say the reference was missing, and if I add it manually it works, however.....

We don't explicitly reference this dll, we reference system.web.optimisation, and its this that has web.infrastructure as a dependency.

Looks likes the NuGet manager isn't making this connection between the 2.

Andy
Glad the issue has been resolved.

Dan
Thanks Dan