evil COM & reflection problem please help :(

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.
 
O

Oberdan Borges Nunes

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top