I already have an article on problems with using Apprentice from a side thread, which also mentions that this side thread needs to be a single-threaded apartment. However, the main thread of your application might be a non single-threaded apartment (i.e. multi-threaded apartment) too - something to watch out for.
Depending on the language you are using the default is different:
https://docs.microsoft.com/en-us/dotnet/api/system.stathreadattribute?view=netframework-4.8
So, whatever thread you are creating and using your ApprenticeServerComponent from, it needs to be a single-threaded apartment type. You can simply add the [STAThread] attribute to your application's Main function:
namespace MyApp
{
static class Program
{
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MyForm());
}
}
}
As a background info, Windows Form components (like AxHost) require the use of single-threaded apartment. As mentioned in the Rule Description:
"... if it is omitted, the Windows components might not work correctly. "