I am using MVC 5, WCF and Unity framework in my application.
I am getting below error when I run WCF service:
Server Error in \'/\' Application.
Co
Be sure that your project targets .net 4.5, that all references are valid and that web AspNet.WebPages.* are in the bin (Release/Debug) folder.
You may also try to reinstall Microsoft.AspNet.WebPages nuget packages using this command in the package manager console
> Update-Package –reinstall Microsoft.AspNet.WebPages
I was encountering the exact error here (among a couple other missing reference errors) on my Win10 x64 system. My issue was (I believe), was caused by uninstalling something from add/remove that ripped out other dlls.
After scouring the internet for a solution, what finally worked for me was the answer here: https://stackoverflow.com/a/27785999/692124
Download and install Web Pages Version 2
I had same issue where WCF was showing error of unrelated MVC assembly (I have multiple MVC projects in solution which are using System.Web.WebPages.Razor, Version=3.0.0.0). I installed Microsoft.AspNet.WebPages package in the WCF project , ran WCF proj and It worked. After that I had uninstalled all Microsoft.AspNet.WebPages related packages. It worked fine.