I have 2 issues in the same project.

Issue 1:
I have a project using the Object API. I've created a VB.NET assembly that encapsulates the Object API's in this project. The assembly is instantiated from a VB.NET form application for testing. When calling one of the methods in the assembly by pressing a button the function runs fine. However, when running the same function from a background worker, it throws an exception. I've included a sample project here that replicates the issue.

Issue 2:
The same project is also called from a batch file. When testing the app from the debugger, again it runs fine. When calling the app from the batch file, an exception is thrown instantiating the GroupWise Application object. Again, i've included sample code.

If anyone can shed some light on these isssues, I would appreciate it.