evil COM & reflection problem please help :(

  • Thread starter Thread starter realgeek
  • Start date Start date
R

realgeek

I can't get my head around the following problem no matter how I try.
..NET 1.1, C#.
There's an assembly A that outputs a COM component.
It dynamically loads a class from assembly B using Activator (assembly
B is loaded from a file).
Assembly B uses a class from assembly C that sits in GAC; project B
references a dll in project C output folder to make this possible.
Everything works.

As soon as the version of assembly C changes, project B start
referencing the new version and everything breaks, when I call
activator.CreateInstance in assembly A I get an error telling me it
cannot load the assembly C (even though the old version is in GAC and
they are 100% compartable).

How do I make the loader ignore versions and use the assembly from GAC
anyway?
Or, how do I reference the assembly right in the GAC?
Right now I have to reinstall assembly into GAC after each error and I
suspect there might be some problems on users' machines when I deploy.
 
You have to be carefull with the dll versions of the new C assembly
versions.
..Net uses some rules to determine with version of dlls in CAG it'll loads.

See the msdn about assembly versions rules..
Another way is make a reference to a specific version of assembly, you can
do it in app.config.

[]'s
Oberdan
 
Back
Top