title: 'var_name'is not declared. It may be inaccessible due to its protection level.' in debug mode
body: <p>This behavior is in a vb.net web application solution with multiple class library projects referenced by the web app.</p>
  
  <p>The code compiles, but in debug mode, some functions/subroutines in the referenced class libraries have local variables that display </p>
  
  <blockquote>
    <p><em>'var_name'</em> is not declared.  It may be inaccessible due to its
    protection level.</p>
  </blockquote>
  
  <p>in the watch and immediate windows.</p>
  
  <p>The mouse_over intellisense doesn't work on those local variables.</p>
  
  <p>In some sub/functions the variables' values are accessible until I step into a <code>Try..Catch</code></p>
  
  <p>All variables passed into the Sub/Function are accessible. Variables defined at the class level are accessible, too.</p>
  
  <p>This behavior is new in code that has been in the solution for years.  The scope of the subroutines and functions have not changed (they are Public).</p>
  
  <p>It is not consistent either.  In a given class library project, public functions/subroutines in one class will have local variables where you can see their values, while others display the message shown above.</p>
  
  <p>Things I have already tried:</p>
  
  <pre><code>* Clean/Rebuild Solution
  * Turn off Code optimizations (it has always been turned off in Debug mode)
  * Enable the "Show all members for non-user objects in variables windows (Visual Studio)" option in the Debugging options.
  * Import default settings for VS2012
  * Update VS2012 to latest version (Update 4)
  * Install VS2013 and open solution (behavior occurs there as well)
  * Clear AppData cache
  * In Advanced Compiler Settings, set 'Generate debug info' to both Full and pdb-only
  * Remove local copy of solution and get the solution again from TFS
  * All projects in the solution are set to Debug
  </code></pre>
  
  <p>I have multiple solutions in TFS and this is the only solution that shows this behavior.</p>
  
  <p>I have had a colleague get a copy of the same solution in TFS and the behavior does NOT occur in his local copy.</p>
  
  <p>This behavior did not occur in VS2010.</p>
  
  <hr>
  
  <p>Here is an example of a method and local variable declarations where this behavior occurs.
  If you step through the declarations and set watch on any of the local variables or any statements using the local variables, you will see  </p>
  
  <blockquote>
    <p><em>'var_name'</em> is not declared.  It may be inaccessible due to its
    protection level.</p>
  </blockquote>
  
  <p>as the value of the variable in the watch/quick watch/immediate windows</p>
  
  <h2>Utility1.vb</h2>
  
  <pre><code>Imports System.Web
  
  Imports System.Text
  
  Imports SPBO
  
  Public Class Utility1
  
  Public oNav_inc As New Navigation_INC
  '===========================================================================
  'Utility1.vb
  '===========================================================================
      Public Sub UTIL_EstablishActivityContext(ByRef Response As HttpResponse, ByRef page As Page, ByRef oGlobal_inc As GlobalVariables_INC)
  
          Dim oActivity As ENC2.Web.ActivityContext
          Dim oMHardUBO As MHUBO
          Dim oPUBO As PUBO
          Dim asGroup As String = ""
          Dim sGroup As String = ""
          Dim bActive As Boolean
          Dim g_oUserAccountBO As UserAccountBO
          Dim sImplementation As String = ""
          Dim rs As DataSet
          Dim sQuery As String
          Dim rsUser As DataSet
          Dim sUserGroups As Object
          Dim iLoop As Integer
          Dim bInternal As Boolean
          Dim g_bInternalUser As Boolean
  
          g_bInternalUser = False
  
          'rest of code
  
      End Sub
  
  End Class
  </code></pre>
  
  <hr>
  
  <p>UPDATE:  I went ahead and reformatted/reimaged my laptop and installed VS2013.  The issue is no longer appearing.</p>