title: Protected vs protected internal (Again) in c#
body: <p>I am raising a question (again) on the <code>protected</code> vs <code>protected internal</code> as I am still unsure and not able to get a grip on them.</p>
  
  <p>Any help is much appreciated.</p>
  
  <p><strong>// DLL 1</strong></p>
  
  <pre><code> namespace Assembly1
    {
      class class1 : class2
      {
        static void Main()
        {
           new class1().Test();
        }
  
        private void Test()
        {
           Console.WriteLine(this.sample);
        }
      }
   }
  </code></pre>
  
  <p><strong>// DLL 2</strong> </p>
  
  <pre><code> namespace Assembly2
      {
          public class class2
          {
            // protected string sample = "Test";           
               protected internal string sample = "Test";
  
         //Same behavior when using protected and protected internal. Why ?
  
      }
  }
  </code></pre>
  
  <p>I am getting the same behaviour for both the lines.</p>
  
  <pre><code>      // protected string sample = "Test";           
           protected internal string sample = "Test";
  </code></pre>
  
  <p>But I am sure that there should be some difference.</p>
  
  <blockquote>
    <p><strong>MSDN says:</strong><br>
    <em>Protected:</em> Access is limited to the containing class or types derived from the containing class.</p>
    
    <p><em>Protected Internal:</em>  Access is limited to the current assembly or types derived from the containing class.</p>
  </blockquote>
  
  <p>I am able to access both <code>protected</code> and <code>protected internal</code> from outside assemblies as long as I inherit from the base class. </p>
  
  <p>Pretty confusing! both looks exactly similar. Can any one explain me by modifying from the above example ?</p>