I have an application that uses some classes from the native COM DLL in an isolated deployment.
Simplified: At runtime, I load the dll with the manifest file into a specific directory without registering it. Then I create an activation context pointing to this directory, and then create class instances from the dll. Suppose we create class A after class B. Everything is going well in this thread.
The problem started when I changed the application to WinForm. When the "1" button is pressed, I create the activation context as before, and then create an instance of class A. This works well and the thread returns to my WinForm. However, when the "2" button is pressed, I cannot create class B. I get an exception saying that the class cannot be found!
So, it looks like WinForm will somehow ruin my activation context. - Why is this? What is happening there? - Is there a way around this?
A few notes: - I tried the following activation context creation using sxstrace.exe, however it only registered my activation context creation. - I tried to comment on Application.EnableVisualStyles (), but that didn't help. - If I complete each call to my DLL, creating and destroying the activation context, it works, but, of course, I do not want to get there.
source
share