title: "The Master Page file '....' cannot be loaded" error from Visual Studio 2008
body: <p>I have a basic ASP.Net project created in Visual Studio 2008 on Windows Server 2008.</p>
  
  <p>It uses a Master Page for the core design and has a set of pages inheriting from that.</p>
  
  <p>This morning I came in to a message saying an update had been installed and one of my files needed to be recovered. When the recovery was complete, I could no longer open the page in the Visual Studio Design view, I just get the following message:</p>
  
  <blockquote>
    <p><strong>Master Page Error</strong></p>
    
    <p>The Master Page file '~/MyProject.Master' cannot be loaded.</p>
    
    <p>Correct the problem in Code View</p>
  </blockquote>
  
  <p>There is, however nothing to correct so far as I can see. The file is no different to other pages that also inherit the same Master page and display correctly. Changing the Master page to something that genuinely doesn't exist makes no difference. Neither does changing it back to the real Master page.</p>
  
  <p>The page displays correctly in the browser, it is literally only the designer that seems to have the problem and only on this one page. I can see no changes in the Source Control history that would explain this change. </p>
  
  <p>The other problem that appears to happen as a consequence is that if I add new Asp.net controls to the page in the Source view, they don't get automatically wired up into the designer class or the codebehind.</p>
  
  <p>Stopping and restarting Visual Studio does not seem to have changed matters. Is there anywhere this error could be getting cached by VS.Net?</p>
  
  <p>The only mentions of this I can find seem to be in very old bug reports <a href="http://connect.microsoft.com/VisualStudio/feedback/details/333806/the-master-page-file-cannot-be-loaded" rel="nofollow">like this one</a> but I can't find any evidence of how or whether the issue was solved even though the reports go back a few years now.</p>