MVC 4 Controller Compilation Error trying to return a Model
- by Joe
This is a newbie configuration problem I suspect.
See return statement comment in code snippet.
[HttpGet]
public ActionResult TestService()
{
ViewBag.Message = "DataLayer Service";
Service dataLayerService = new Service {CookieContainer = new CookieContainer()};
dataLayerService.SetSessionAppName("SAND");
WebServiceModel webServiceModel = new WebServiceModel();
webServiceModel.Result = dataLayerService.GetSessionAppName();
return this.View(webServiceModel); // <== Cannot resolve View "TestService"
}