-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
During review of PR #1868 I noticed IOleInPlaceActiveObject was declared with both [ComImport] and [ComVisible(true)]. This is wrong, ComVisible(true) is for interfaces owned by the assembly, ComImport is for external interfaces.
In desktop framework this probably has little consequence since the assemblies come preinstalled, but now that its possible to deploy WinForms with an application it may more likely be processed by tools like regasm or TLB generators, which attempt to register COM interop owned by the assembly.
When ComVisible(true) is present this will cause registry corruption by overwriting the true owners registry entries (usually owned by Windows OS) and replacing them by .NET based values. For interfaces I believe this mostly replaces the ProxyStubClsid32 pointing to another implementation than the original entries used to have.
There should be a review for conflicting ComImport/ComVisible(true) entries, or better, just review ComVisible(true) in general and make sure it is only placed on classes/interfaces owned by WinForms.