title: ASP.NET: "The resource class for this page was not found."
body: <p>Myself and a colleague have recently upgraded to Windows Vista, and have been using it to develop ASP.NET applications with Visual Studio 2008 without many issues. And up until this morning, I <em>had</em> been managing to use local resources fine too.</p>
  
  <p>However, this morning, my application suddenly stopped working with local resources, in the sense that any controls with a meta:resourcekey attribute suddenly display an empty string. At first, I thought it was something I had done to the application, so I created a brand new web application, added a label to an ASPX page, and generated a local resource from it. But running it has the same issue - the text simply isn't displayed. See attached screenshot for the example, and its output.</p>
  
  <p>However, running it on my colleague's machine (who also has Vista), works without issue.</p>
  
  <p>Incidently, if I try to get the value in the code behind, it throws this exception:</p>
  
  <hr>
  
  <pre><code>Server Error in '/Resources' Application. The resource class for this page was not found.  Please check if the resource file exists and try again. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
  
  Exception Details: System.InvalidOperationException: The resource class for this page was not found.  Please check if the resource file exists and try again.
  
  Source Error:
  
  Line 12:             protected void Page_Load(object sender, EventArgs e) Line 13:             { Line 14:        object x = HttpContext.GetLocalResourceObject("~/Default.aspx", "lblTestResource1.Text"); Line 15:     } Line 16:       }
  
  Source File: C:\inetpub\wwwroot.Net2\Standalone\Resources\Resources\Default.aspx.cs Line: 14
  
  Stack Trace:
  
  [InvalidOperationException: The resource class for this page was not found.  Please check if the resource file exists and try again.]    System.Web.Compilation.LocalResXResourceProvider.CreateResourceManager()
  +2468866    System.Web.Compilation.BaseResXResourceProvider.EnsureResourceManager()
  +20    System.Web.Compilation.BaseResXResourceProvider.GetObject(String resourceKey, CultureInfo culture) +15  System.Web.Compilation.ResourceExpressionBuilder.GetResourceObject(IResourceProvider resourceProvider, String resourceKey, CultureInfo culture, Type objType, String propName) +21    System.Web.HttpContext.GetLocalResourceObject(String virtualPath, String resourceKey, CultureInfo culture) +38    System.Web.HttpContext.GetLocalResourceObject(String virtualPath, String resourceKey) +6    Resources._Default.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot.Net2\Standalone\Resources\Resources\Default.aspx.cs:14 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
  +14    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35    System.Web.UI.Control.OnLoad(EventArgs e) +99    System.Web.UI.Control.LoadRecursive()
  +50    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
  
  Version Information: Microsoft .NET Framework Version:2.0.50727.3074; ASP.NET Version:2.0.50727.3074
  </code></pre>
  
  <hr>
  
  <p>Anyone have any idea? The weird thing is that using resources <em>was</em> working. I have tried restarting my computer, and clearing my Temporary ASP.NET files - but the issue remains.</p>
  
  <p>Many thanks</p>
  
  <p>Steve</p>