Pregunta

Can I register a .Net COM class with the SingleUse-flag?

The reason I want to use SingleUse is that otherwise the static fields inside the COM instances (the client application uses 2 instances with different database connection strings) are shared resulting in any COM instance to access the same database.

¿Fue útil?

Solución

No, this doesn't go in the registry. It is a property of an out-of-process COM server, used when it registers its class factories. The dwClsContext argument for CoRegisterClassObject().

Using static fields is your mistake. Easy to fix.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top