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 5952185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:38:43+00:00 2026-05-22T17:38:43+00:00

We just got a new Windows 2008 R2 server and I am trying to

  • 0

We just got a new Windows 2008 R2 server and I am trying to set up an MVC 3 site in IIS 7.5 with the Razor View Engine. I am getting a strange error when I access the default route.

The layout page
“~/Views/Shared/_Layout.cshtml” could
not be found at the following path:
“~/Views/Shared/_Layout.cshtml”.

This is strange because I explicitly set the Layout from within /views/home/index.cshtml like so:

@{
  Layout = "~/Views/Shared/_Layout.cshtml";
}

I am 100% certain that the /views/shared/_layout.cshtml exists in the file system. Here’s a screenshot.

enter image description here

If I remove the Layout = "~/Views/Shared/_Layout.cshtml"; from my view, the page will render out the contents of /home/index.cshtml all by itself (without any of the code from _Layout.cshtml). I have also tried setting the layout using _ViewStart.cshtml.

Anyone know why MVC wouldn’t be able to “find” the layout file? This website works perfectly fine when running in the built-in web server for visual studio.

Here’s my stack trace:

[HttpException (0x80004005): The layout page "~/Views/Shared/_Layout.cshtml" could not be found at the following path: "~/Views/Shared/_Layout.cshtml".]
   System.Web.WebPages.WebPageExecutingBase.NormalizeLayoutPagePath(String layoutPage) +204956
   System.Web.WebPages.WebPageBase.PopContext() +150
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +384
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +33
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +784900
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +265
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +784976
   System.Web.Mvc.Controller.ExecuteCore() +159
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +335
   System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +62
   System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +20
   System.Web.Mvc.<>c__DisplayClasse.<EndProcessRequest>b__d() +54
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +453
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +371
  • 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-22T17:38:44+00:00Added an answer on May 22, 2026 at 5:38 pm

    It seems like you probably have a permissions issue. With the info you’ve given, it seems like the most likely cause of not being able to find the _Layout.cshtml file.

    With Server 2008 and IIS 7, application pool’s have their own identity used for ACL’s (named IIS AppPool{App Pool Name}), and these identities are made part of the IIS_IUSRS group. Also, your default inetpub/wwwroot directory will have read permissions for the IIS_ISRS group. So, if your not getting the permissions you need, I would think that the App pool is not in fact running with the correct identity.

    One reason the identity may be incorrect is the setting for Anonymous Authentication user identity. Go into the Authentication control for the site (or the whole server) and edit the Anonymous Authentication rule to run as the Application Pool Identity.

    This is a bit of a guess, but it seemed this fellow had nearly the exact same issue.

    IIS Anonymous Authentication user identity screen

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

Sidebar

Related Questions

I just got a new windows server 2008 dedicated server and I can't for
I just got a Windows Server 2008 VPS and I'm having trouble getting IIS7
I just got myself a new toy, a phone with Windows Mobile 6. I'm
I just got a shiny, brand-new Debian server handed to me by our Systems
I set up my hMailServer on my windows 2008 machine, and I'm trying to
I just got a dedicated server from a hosting company, and for some reason,
I just got my azure invitation code...yay! Are there any official samples for windows
I'm using TortiseSVN for my subversion client on a Windows Server 2008 box and
I've got a site using .netCART . It's running fine in production with Windows
I'm using a Windows Server 2008 x64 R2 machine as a development box. Amongst

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.