G
Guest
I'll try to keep my explanation as simple as I can but leave in the relevant
details.
We're developing in c#.
Our main application can dynamically load assemblies ( plugins) that
support a certain interface (to do "extra" functions). Our intent is that
these assemblies won't be updated once fielded, and should be ok, as long as
the interface they're built upon doesn't change. Actually it can change, you
just only add things, not modify/deleted previous ones.
In addition to the interface, we've developed a base class that does a lot
of boiler plate things that all of our plugins will need to do. Our plugins
are built on our base class.
This was going well until some of our plugins (compiled a couple of versions
back) started failing. Both our interface and base have been recompiled, and
version number updated - but not actually changed.
We've narrowed the failure to those that access a protected property in the
base class. It is indicated as the "field not found". But it hasn't
changed, does exist, and is populated. If the derived class uses a base
class function (also protected) that uses the property, it works fine. But
if the derived class accesses the property, it gives the error.
A couple of other factors.
1) If the plugin is recompiled against the latest version of the
base/interface dlls, it works fine. (even tho no change).
2) The error occurs when the derived FUNCTION that uses the protected field
fails..not on its actual use. I verified this a couple of different ways.
I'm confused because I build a simple test case to try it out and it doesn't
fail (unless I really do alter the base class or interface so the protected
property isn't there or its type is changed).
I also disassembled both version of the base class and interface and can't
find any substantial differences. A couple of sizes changed.
So I'm looking for any clues or things to try. I plan on eliminating all
base member access (no more protected member variables) and I think that
will solve it, but I'd feel better if I could more definatively say why it
failed, duplicate it in my test cases, etc.
***
Restating more simply
A is an interface.
B is base class implementing A.
B has a protected member q. B has a protected function p.
C is a class dereived from B.
C (dynamically loaded into my app)is build against version 1.0 of A and B
and can use p and q fine.
If the app is updated (along with A and B) to version 2.0, and C isn't..any
function of c using q fails with "field not found: q" error. Functions using
p work fine.
A and B didn't change source, other than to update version #.
***
Any thoughts at all are welcome,
Thanks
Roger
details.
We're developing in c#.
Our main application can dynamically load assemblies ( plugins) that
support a certain interface (to do "extra" functions). Our intent is that
these assemblies won't be updated once fielded, and should be ok, as long as
the interface they're built upon doesn't change. Actually it can change, you
just only add things, not modify/deleted previous ones.
In addition to the interface, we've developed a base class that does a lot
of boiler plate things that all of our plugins will need to do. Our plugins
are built on our base class.
This was going well until some of our plugins (compiled a couple of versions
back) started failing. Both our interface and base have been recompiled, and
version number updated - but not actually changed.
We've narrowed the failure to those that access a protected property in the
base class. It is indicated as the "field not found". But it hasn't
changed, does exist, and is populated. If the derived class uses a base
class function (also protected) that uses the property, it works fine. But
if the derived class accesses the property, it gives the error.
A couple of other factors.
1) If the plugin is recompiled against the latest version of the
base/interface dlls, it works fine. (even tho no change).
2) The error occurs when the derived FUNCTION that uses the protected field
fails..not on its actual use. I verified this a couple of different ways.
I'm confused because I build a simple test case to try it out and it doesn't
fail (unless I really do alter the base class or interface so the protected
property isn't there or its type is changed).
I also disassembled both version of the base class and interface and can't
find any substantial differences. A couple of sizes changed.
So I'm looking for any clues or things to try. I plan on eliminating all
base member access (no more protected member variables) and I think that
will solve it, but I'd feel better if I could more definatively say why it
failed, duplicate it in my test cases, etc.
***
Restating more simply
A is an interface.
B is base class implementing A.
B has a protected member q. B has a protected function p.
C is a class dereived from B.
C (dynamically loaded into my app)is build against version 1.0 of A and B
and can use p and q fine.
If the app is updated (along with A and B) to version 2.0, and C isn't..any
function of c using q fails with "field not found: q" error. Functions using
p work fine.
A and B didn't change source, other than to update version #.
***
Any thoughts at all are welcome,
Thanks
Roger