title: * is not declared. It may be inaccessible due to its protection level
body: <p>I've got a problem with one of my web forms pages.</p>
  
  <p>this is how it started.
  I needed to completely revamp a page, I renamed the old pages default.aspx.vb.old and default.aspx.old and created brand new default.aspx and default.aspx.vb pages</p>
  
  <p>every time I add a control to the aspx page and try and reference it in the code behind, I get the error <code>'lblError' is not declared. It may be inaccessible due to its protection level</code></p>
  
  <p><strong>Page decalaration</strong> </p>
  
  <pre><code>&lt;%@ Page Title="" Language="VB" MasterPageFile="~/_Masters/Principle.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Magazine_Default" EnableViewState="false" %&gt;
  </code></pre>
  
  <p><strong>Label control in Default.aspx</strong></p>
  
  <pre><code>&lt;asp:Label ID="lblError" runat="server" CssClass="cError" Visible="false" /&gt;
  </code></pre>
  
  <p><strong>Default.aspx.vb Code Behind</strong></p>
  
  <pre><code>Partial Class Magazine_Default
      Inherits System.Web.UI.Page
  
      Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      lblError.Text = "There was a problem retrieving the magazines, please try again later"
      End Sub
  End Class
  </code></pre>
  
  <p>the page works, but visual studio will not build because it insists there is an error.</p>
  
  <p>I thought it might be something up with my visual studio, like cache or something, so i nuked any temp files relating to the project.</p>
  
  <p>and this morning a colleague did a git pull and has the same problem, errors are there, refuses to build but the page works.</p>
  
  <p>The project itself is a website project, so there's no designer files where I can change the access modifier of the control.</p>
  
  <p>I have also tried creating a new file, using the web form scaffolding that visual studio provides through <code>add-&gt;web form</code>, which has all the correct page directives in the .aspx and correct class declarations in the .aspx.vb, and it still does it.</p>
  
  <p>There is also no red squiggly line under <code>lblError.Text</code></p>
  
  <p>When I create a new page in the different folder, it doesn't happen.</p>