System.Web.WebPages.Deployment Error

info's Avatar


21 Jul, 2014 08:50 PM


I'm currently trying to deploy a build from a BitBucket -> AppVeyor (Web Deploy) -> Azure Website (Web Deploy) workstream, and I'm getting the following error on site once built and loaded:

Could not load file or assembly 'System.Web.WebPages.Deployment, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

From searching around the web, I get the feeling that the following in web.config may be the culprit, but I'm far from an MSBuild expert:

        <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="" newVersion="" />

Has anyone seen this before and could provide some pointers to help me become unstuck?



  1. Support Staff 1 Posted by Feodor Fitsner on 22 Jul, 2014 05:22 AM

    Feodor Fitsner's Avatar

    Hi Henry,

    Make sure you have System.Web.WebPages.Deployment.dll in bin folder of your app.

  2. 2 Posted by info on 22 Jul, 2014 09:05 PM

    info's Avatar

    Hi Feodor,
    Thanks for your reply : you're suggestion fixed our issue. I just created a /Lib directory and put the missing DLLs in there and referenced those in the project, making sure to set Copy Local = True.
    One question as a follow on to this:
    Is there a recommended way to use some sort of test to detect errors such as missing assemblies etc that are only required at runtime?
    In this case instance, would precompilation of the razor views have helped create a failing build, thus flagging the issue earlier?
    Any resources/ideas you can point me to would be much appreciated.

  3. Support Staff 3 Posted by Feodor Fitsner on 23 Jul, 2014 04:44 AM

    Feodor Fitsner's Avatar

    Great, thanks for the update!

    My advice would be using NuGet to manage project dependencies. This case it's easier to see what's required and you don't to keep assemblies in the repository.

  4. 4 Posted by info on 23 Jul, 2014 06:40 AM

    info's Avatar

    Thanks Feodor :)
    I use Nuget for all other dependencies, but hadn't considered using it for what I thought were mostly GAC dependencies these days available on most machines (MVC etc). I'll use Nuget in the future though to manage how the dependencies are added and restored for framework dependencies like MVC.
    Please feel free to close out this ticket or mark as resolved.

  5. info closed this discussion on 16 Jan, 2015 12:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac