Closed masterprogrammer513 closed 2 months ago
Any news?
@masterprogrammer513 COM components are now always isolated. This behavior can be altered as described here. Ideally this would handled in a more precise manner by directly managing AssemblyLoadContext
s.
I am facing a problem with COM interop in VB6 after migrating from .NET 4.8 to .NET 8. This setup used to work perfectly in .NET 4.8 but is now failing in .NET 8.
Here's the setup:
I have a BaseClass in ASM1 defined as BaseClass : IBaseClass. There is another assembly, ASM2, which has a method like Method(BaseClass baseClass). Both classes are properly implemented with ComVisible attributes and have the necessary GUIDs, etc.
Here is the problematic VB6 code:
vb6 Copy code
Has anyone encountered a similar issue when migrating from .NET 4.8 to .NET 8? How can I resolve this casting problem?
This is a sample project
https://github.com/masterprogrammer513/Com-Net8-Problem
net48 assembly load
Net8 assembly load
.net8 loads a PrentCom multiple times in different contexts which makes a casting problem