title: VB6 App using COM Interop works fine in IDE, but compiled EXE crashes
body: <p>I am currently working on an app in VB6 that uses COM Interop libraries written in C# using the .NET 2.0 framework.</p>
  
  <p>I used regasm.exe to register the tlb files from the .NET dlls using the /codebase switch. I was then able to successfully build and run the application in the VB6 IDE with no issues. The .NET code uses a config file, so I added it to the VB6 directory and it read from the configurations fine.</p>
  
  <p>However, I then compiled an EXE file from the project an ran it on the same machine as the IDE is running on. I coupled the EXE with the config file just as I had done in debugging with the VB6.EXE, but when the app executes the first call to a method in one of the .NET classes, it throws a run-time error indicating an "Automation Error".</p>
  
  <p>In my Declarations, I instantiate the following objects from the .NET classes, which seems to work fine.</p>
  
  <pre><code>Private objSession As New Session
  Private curFolder As Folder
  Private colFolderTemplates As New FolderTemplateCollection
  Private objLicense As New License
  </code></pre>
  
  <p>However, the Automation Error comes up at runtime when the first line is executed:</p>
  
  <pre><code>Call objSession.Configuration.Configure(connectionString)
  </code></pre>
  
  <p>I tried adding the .NET dlls to the same directory as the Release EXE and re-registering the tlb files, but it did not help. Any suggestions on what I could check?</p>