W
Walter Fettich
I have the following problem:
I have two assemblies:
An exe: Apllication.exe
and a dll: Service.dll
What I want to do is load the dll in my exe dynamically using Assembly.Load
and create an object of type Service.Service1.
The problem is that the class Service.Service1 is derived from class
Serivce.ServiceCommon which is also known to Application (the first
assembly). When I try to cast Service.Service1 to Service.ServiceCommon i
get an invalid cast exception even if I know it is valid because it is
derived from that type. It must be a problem because the CLR believes
Service.ServiceCommon to be different for each assembly even if it has the
same body.
Does anyone know of a better solution to use a common type in two assemblies
I have two assemblies:
An exe: Apllication.exe
and a dll: Service.dll
What I want to do is load the dll in my exe dynamically using Assembly.Load
and create an object of type Service.Service1.
The problem is that the class Service.Service1 is derived from class
Serivce.ServiceCommon which is also known to Application (the first
assembly). When I try to cast Service.Service1 to Service.ServiceCommon i
get an invalid cast exception even if I know it is valid because it is
derived from that type. It must be a problem because the CLR believes
Service.ServiceCommon to be different for each assembly even if it has the
same body.
Does anyone know of a better solution to use a common type in two assemblies