I had a problem where, working on a new MVC project, as soon as I added Html.Partial(\"Name\") to my _Layout.cshtml page, ASP.NET would throw this
I ran into a similar situation.I had an MVC project with Unity. Project was targeting .Net version 4.5.1 but my build machine was missing the 4.5.1 folder in C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework folder.
So what solved my problem was copying v4.5.1 folder from my dev machine to the build machine.
You can find the link to the original answer here