0
votes

Error:

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched: ~/Areas/AdminAssignment/Views/Calendar/Index.aspx ~/Areas/AdminAssignment/Views/Calendar/Index.ascx ~/Areas/AdminAssignment/Views/Shared/Index.aspx ~/Areas/AdminAssignment/Views/Shared/Index.ascx ~/Views/Calendar/Index.aspx ~/Views/Calendar/Index.ascx ~/Views/Shared/Index.aspx ~/Views/Shared/Index.ascx ~/Areas/AdminAssignment/Views/Calendar/Index.cshtml ~/Areas/AdminAssignment/Views/Calendar/Index.vbhtml ~/Areas/AdminAssignment/Views/Shared/Index.cshtml ~/Areas/AdminAssignment/Views/Shared/Index.vbhtml ~/Views/Calendar/Index.cshtml ~/Views/Calendar/Index.vbhtml ~/Views/Shared/Index.cshtml ~/Views/Shared/Index.vbhtml

My folder structure is as follows:

MVCApp.WebUI
- Areas
  -AdminAssignment
    -Controllers
    -Models
    -Views
      -Calendar
        -Index.cshtml

when i try to browse directly to Index.cshtml I receive a HTTP 404 error. I tried changing the build on the view to 'content' but that didn't do anything. Completely confused as to why it cannot find it considering '~/Areas/AdminAssignment/Views/Calendar/Index.cshtml' is the actual path of the file.

Would appreciate if someone can point me in the right direction!

Thanks!

1
Show us the action impelmentation that return the view, pleaseCodeNotFound
Are you able to find any other views in that folder/area?krillgar
No action. It's just URL link on another view: basically a link to:localhost:56079/AdminAssignment/Calendaruser5120455
And no, can't find other views in that folder/area :(user5120455
Go to the relevant view properties and make sure BuildAction=Content and Copy to Output Directory=Do not copyOrel Eraki

1 Answers

1
votes

You have to look at URL in error message. The following locations were searched: this is not correct ~/Areas/AdminAssignment/Views/Calendar/Index.aspx correct url: /Areas/AdminAssignment/Views/Calendar/Index