Saturday, December 01, 2012

Error: Resource cannot be found in MVC 3.0  application

I observed this error when I was working in one of MVC (Razor View) application, I got confused when all my page is available in correct View folder then why this error thrown. Finally I found there was no mistake from my implementation or page name etc.


The problem was if you are running MVC application by Visual Studio and any of  view ( .cshtml or .aspx) file open (in Active tab) in Visual Studio and you are the running the application by clicking (F5 or Ctrl+F5) than you will get this error. Visual Studio not goes to start up page it is considering open page (in Active tab) as start up page.

Close all view files (.cshtml or .aspx) and then run application by F5 or Ctrl+F5 or open .cs files in Active tab in Visual Studio. It ok to open .cs files.

No comments: