title: Why can't I call private shared methods from a public shared method in vb.net?
body: <p>I have a class like this:</p>
  
  <pre><code>class Foo
      private shared default_ = "DEFAULT"
  
      public shared function bar(val as object) as string
          if val is Nothing then return _default
  
          return getBar(val)
      end function
  
      private shared function getBar(val as string) as string
          return formatString(val)
      end function
  
      private shared function getBar(val as System.Int32) as string
          return formatInt(val)
      end function
  end class
  </code></pre>
  
  <p>formatString and FormatInt being public shared methods.
  When I call Foo.bar, I get a MissingMemberException:</p>
  
  <pre><code>System.MissingMemberException: Public member 'getBar' on type 'Foo' not found.
  </code></pre>
  
  <p>It works, when I make getBar methods public, but I don't want to expose these unneccessarily. Why I can't call private shared methods from a public one in the same class is over my head.</p>
  
  <p>I'm using .net framework 4.0 in a web application.</p>