our application should use the SingleThreadedApartment for COM-Interop.
Till now we used the STAThreadAttribute.
For some other reasons we now have to set the ApartmentState-Property in the Main-Method, so the Attribute isn't used anymore.
This works fine. But when I start the process from profiler, then the apartment state gets multithreaded. I think it is because profiling code is executed before our code is called.
Is there any possibility to set the appertment state in code and using profiling?
Users browsing this forum: No registered users and 3 guests