none
Base Class Versioning Question RRS feed

  • Question

  • Hello.

    I did a few searches, but I couldn't find anyone who has seen this particular problem I'm having at the moment.

    We have an application here that is structured like so:

    App.exe - references only component B
    Component B - contains base classes B1 (some data structure) and B2 (performs action on data structure)

    From there, we have a number of libraries that App.exe loads from the GAC via reflection that contains classes derived from B1 and B2, let's call them C1, C2, D1, and D2.

    We recently found a critical bug in an older version of this application that needed to be fixed in multiple release lines 1.5 and 2.0.  The fix was solely in B2 (data structure did not change, neither were there any function signature changes or function additions).  We produce versions 1.5.1 and 2.0.1 of Component B from their respective code base and update App.exe.config to redirect use this new base class.

    I would not expect this to work solely by redirecting the application to use Component B because the runtime doesn't know if the data structure B1 v1.5 is compatible with B1 v1.5.1 and similarly with 2.0 and 2.0.1.  However, we tell it in the exe.config to redirect to use the new version of Component B, and both Components C v1.5 and D v1.5 work fine with the new Component B v1.5.1.  The problem is that in v2.0.1 we get an exception in loading Component D that says a particular function does not have an implementation.

    I'm not sure where to go from here after reading mixed feelings towards changing only the AssemblyFileVersion if the library is highly compatible and doing an in-place upgrade, but we don't want to rebuild the entire lines of components that derive from B1 and B2 just because we made an internal bug fix to a strong-named assembly.  Any thoughts or suggestions, or am I missing something basic?
    • Edited by JeffHES Tuesday, August 19, 2008 5:39 PM made last paragraph more clear (hopefully)
    Tuesday, August 19, 2008 5:38 PM

Answers

  • > just because we made an internal bug fix to a strong-named assembly.

    You can also deploy a publisher policy to avoid having to edit all of the .config files of all of the applications that use your library.

    http://msdn.microsoft.com/en-us/library/dz32563a.aspx

    > we get an exception in loading Component D that says a particular function does not have an implementation

    Not sure what this could be.  Sounds like 2.0.1 is missing a method that 2.0 had.
    • Marked as answer by Zhi-Xin Ye Monday, August 25, 2008 10:33 AM
    Wednesday, August 20, 2008 12:06 AM