Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6625689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:48:14+00:00 2026-05-25T21:48:14+00:00

In my /Views/Shared/ folder I created an EntityNotFound.cshtml razor view. In one of my

  • 0

In my /Views/Shared/ folder I created an EntityNotFound.cshtml razor view. In one of my controller actions I have the following call:

return View(MVC.Shared.Views.EntityNotFound, "Company");

This causes the following exception:

System.InvalidOperationException: The view ‘~/Views/Shared/EntityNotFound.cshtml’ or its master was not found or no view engine supports the searched locations. The following locations were searched:

~/Views/Company/Company.cshtml

~/Views/Company/Company.vbhtml

~/Views/Shared/Company.cshtml

~/Views/Shared/Company.vbhtml

I am confused, because it does not even seem to be attempting to search ~/Views/Shared/EntityNotFound.cshtml. Even if I replace MVC.Shared.Views.EntityNotFound with "EntityNotFound" I get the same error.

Why is Asp.Net MVC not even attempting to find my shared view?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:48:15+00:00Added an answer on May 25, 2026 at 9:48 pm

    Have a look at the list of overloads for View();

    http://msdn.microsoft.com/en-us/library/system.web.mvc.controller.view.aspx

    Specifically, when you pass View(string,string); it sees the second string as the name of the master view.

    Whats probably happening, is that it can’t find the “Company” master view, you’ll not the exception messages says

    … or its master was not found…

    Which means that it is probably finding the NotFoundException.cshtml, but can’t correctly find the Company.cshtml that it’s looking for as the master.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following view: @model MyModel1 @{ ViewBag.Title = Index; Layout = ~/Views/Shared/_Layout.cshtml;
Inside the Views -> Shared folder I have the DateTime.ascx partial view; <%@ Control
In Razor, I have a few that's located in ~/areas/shared/views/shared/_partialName.cshtml . If I do
I have a view folder structure: Views Admin Post New and routing is defined
The below image shows the Partial View GetMovieTypes.cshtml living in the Shared folder I
I have a partial view that is shared between two controllers and I'm trying
In my apllication in each view I have a shared user control that each
I have this class: class View(object): def main_page(self, extra_placeholders = None): file = '/media/Shared/sites/www/subdomains/pypular/static/layout.tmpl'
I'm trying to use DateTimePicker in my application. I create Date.cshtml under the View/Shared/EditorTemplates
I created an asp mvc3 project, I want to have a different _Layout.cshtml depending

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.