Can I use regasm to register a .Net COM as SingleUse
-
26-04-2021 - |
Frage
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.
Lösung
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.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow