Today while updating a previously Visual Studio 2010 Website to use Visual Studio 2012 I got an error building the website in VS2012. The website calls some web services and error occurred any way I tried to build the site.
Reference.svcmap: Could not load file or assembly 'System.Web.Mvc, Version=188.8.131.52, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. App_WebReferences/WebServiceName/
This seemed odd because I hadn't used System.Web.Mvc in that project and it wasn't used as namespace or an added assembly. After looking around I did find several posts talking about similar issues and my best guess is that one of the used DLL's actually require it.
While I don't know the exact cause the solution was simple enough. Add the following to the web.conf file.
After which I finally found an answer on stackoverflow with the same solution.
When you add Service References and use the advance settings and but chose to not reuse types in referenced assembles. If you already added the Service Reference edit by clicking Configure Service Reference on the svcmap.
|Add Service Advance Settings - Do not Reuse Types|
I currently don't know why either of these fix it and don't have the time today to dig in and figure out why.