title: Create a subroutine in a VB.Net exe that is callable from another program
body: <p>Is it possible to create a subroutine in a VB.Net exe that is callable from another program(not VB.Net)? I am aware that you can do this with an assembly(dll), but can you do this in an exe as well?</p>
  
  <p>[Edit]This VB.Net exe will already be running when called.</p>
  
  <p>[Edit2] VB.Net program, these compile to become BA_SyncNet.exe - Form1.vb</p>
  
  <pre><code>Public Class Form1
      ...
      Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
          ...
      End Sub
  End Class
  </code></pre>
  
  <p>VB.Net program - Helloworld.vb</p>
  
  <pre><code>Namespace MapInfoBA.MiProBA.SamplesBA
      Public Class HelloWorld
  
          Public Shared Sub SayHello(ByVal s As String)
              System.Windows.Forms.MessageBox.Show("Hello, " + s)
          End Sub
  
      End Class
  End Namespace
  </code></pre>
  
  <p>Calling program ba.mbx uses: </p>
  
  <pre><code>Declare Method SayHello Class "MapInfoBA.MiProBA.SamplesBA.HelloWorld"  Lib "BA_SyncNet.exe" (ByVal strName As String)
  
  Sub Main()
      Call SayHello("World")
  End Sub
  </code></pre>
  
  <p>Kind Regards</p>