I found a problem that is pretty easy to reproduce. Please advise if there is any work for this?
There are two library libraries .Net.dll and library.B.dll.Net. And each library has one InterfaceA and InterfaceB interface. ClassAA implements InterfaceA and lives in libraryA. ClassAB implements interface B and lives in the same library. Similarly, ClassBB - LibraryB - InterfaceB; ClassBA - LibraryB - InterfaceA
The new object works correctly when ClassAA and ClassBB are created, but not ClassAB or ClassBA. They do not constantly create an instance.
Here you are powershell code
[System.Reflection.Assembly]::LoadFile('c:\LibraryA.dll') [System.Reflection.Assembly]::LoadFile('c:\LibraryB.dll') $obj1 = new-object -typeName ClassAA (IT WORKS) $obj2 = new-object -typeName ClassBB (IT WORKS) $obj3 = new-object -typeName ClassAB (EXCEPTION THROWN) $obj4 = new-object -typeName ClassBA (EXCEPTION THROWN)
Thank you very much,
Andrew
source share