Why can't I publish MVC project
- by Vnuk
I'm having problems publishing my MVC project. When I do publish and upload everything to web server I get this:
[InvalidOperationException: The view 'Index' or its master could not be found. The following locations were searched:
~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx]
Weird thing is that Index.aspx exists in ~/Views/Home/, but IIS cannot find it there. If I copy entire project to web server and let asp.net compile it on the fly it works like a charm.
My routing code:
routes.MapRoute( _
"Default", _
"{controller}/{action}/{id}", _
New With {.controller = "Home", .action = "Index", .id = ""} _
)
routes.MapRoute("Root", "", New With {.controller = "Home", .action = "Index", .id =""})
I'm using IIS7 on Windows 2008 Web server. ASP.NET MVC 1.0, Visual Studio 2008. I've tried it local with IIS7 on Windows 7 - same error.