Why can't I publish MVC project

Posted by Vnuk on Stack Overflow See other posts from Stack Overflow or by Vnuk
Published on 2010-01-28T22:19:23Z Indexed on 2010/03/14 14:45 UTC
Read the original article Hit count: 339

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about publish