title: Can't access classes from different files in VB.NET Website
body: <p>I've inherited a VB.NET website and it won't compile because the <code>class1</code> in the file <code>class1.vb</code> refers to <code>class2</code> in a file called <code>class2.vb</code>. I get the following error when trying to compile:</p>
  
  <blockquote>
    <p><code>Type Class2 is not defined.</code></p>
  </blockquote>
  
  <p>When I look in the object browser the classes are listed separately (i.e. not all grouped under the same namespace) and appear as:</p>
  
  <pre><code>Public Class Class 
      Inherits System.Object
       Member of C:\...\mywebsite\
  </code></pre>
  
  <h3>Code:</h3>
  
  <pre><code>Public Class Class1
      Public Enum CountType
          Morning = 0
      End Enum
      Public Sub LogError(ByVal exp As Exception, ByVal err As ErrObject, _ 
                          ByVal sRoutine As String, _
                          Optional ByVal sMod As String = "")
  
      End Sub
  
  End Class
  </code></pre>
  
  <h3><code>Class2.vb</code></h3>
  
  <pre><code>Public Class Class2
  
      Public Enum CountTypes
          Morning = 0
          Noon = 1
          Evening = 2
          Night = 3
          Other = 4
      End Enum
  
      Public Sub LogErrors(ByVal exp As Exception, _ 
                           ByVal err As ErrObject, _
                           ByVal sRoutine As String, _ 
                           Optional ByVal sMod As String = "")
  
      Dim cl As Class1   ' error here
  
      End Sub
  End Class
  </code></pre>