I have two projects: Mvc3TestSvcRef & Mvc4TestSvcRef. Mvc3TestSvcRef is from the ASP.NET MVC 3 template for an intranet application. Mvc4TestSvcRef is from the ASP.NET MVC 4 template for an intranet application.
I'm trying to add a service reference. In Mvc3TestSvcRef, I right-click the project (or the References folder) and choose Add Service Reference. I point to the URL, click Go. When the reference is resolved, I enter a namespace and click OK. As expected, I see the section added to config with the bindings and client tags completed. I can import: "using Mvc3TestSvcRef.MySvcRef;" And write code like:
using (var cl = new MyServiceClient())
{
cl.DoStuff();
}
In Mvc4TestSvcRef, I follow the same steps, but there is no system.servicemodel added to config. Additionally the import: "using Mvc4TestSvcRef.MySvcRef;" cannot be resolved. I've tried this for MVC 4 from both Visual Studio 2010 and Visual Studio 2012.
Was there a major change to the process for adding service references in ASP.NET MVC 4 project type, or am I missing something or have corrupt install?