title: How to inherit from WindowsFormsApplicationBase?
body: <p>I have inherited (look at that, a pun, sorry...) a suite of VB.Net applications which share common functionality, currently "copy and paste" duplicated across all of them. I want to begin the refactoring process. Side note: I am primarily a C# developer, not too familiar with VB.</p>
  
  <p>All of these VB applications are using the "Application Framework". One of the first things I tried to do is get all of them to inherit from a common application base class. I created a new class:</p>
  
  <pre><code>Namespace My
     Public Class ParentApplicationBase
        Inherits Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase
        Public Sub Bar()
           Console.WriteLine("Here we are in Bar()")
        End Sub
     End Class
  End Namespace
  </code></pre>
  
  <p>Then, in ApplicationEvents.vb, ChildApp.vb, and Application.Designer.vb, I changed the</p>
  
  <pre><code>Partial Friend MyApplication
  </code></pre>
  
  <p>to</p>
  
  <pre><code>Partial Friend MyApplication : Inherits ParentApplicationBase
  </code></pre>
  
  <p>However, that results in the error:</p>
  
  <blockquote>
    <p>Base class 'ParentApplicationBase' specified for class 'MyApplication'
    cannot be different from the base class
    'Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase'
    of one of its other partial types.</p>
  </blockquote>
  
  <p>I have double and tripled checked that all of my partial classes are indeed inheriting from ParentApplicationBase. It almost seems like there is some other "hidden" place in the magic of the application framework that is making it think the base class is WindowsFormsApplicationBase rather than ParentApplicationBase.</p>
  
  <p>I have searched both the general web and Stackoverflow in vain. The closest I found was this question <a href="https://stackoverflow.com/questions/9130253/vb-net-how-do-you-change-the-namespace-class-names-for-a-windows-application">VB.NET - How do you change the namespace/class names for a &quot;Windows application&quot; from the default My.MyApplication?</a>, but that did not help.</p>
  
  <p>Thanks in advance for any suggestions!</p>