locked
Component Versioning RRS feed

  • Question

  •  

    Hi Forum

     

    It is possible to have an application use two assemblies with the same name but with different versions using the GAC.

    But what about configuration. If the two assemblies look for the same configuration but the new version of the configuration is not backwards compatible - then what?

     

    Is there any way to have assembly-version-specific-configuration?

     

    Example:

     

    Application X uses 2 modules.

     

    Module A and Module B. These modules have been written used Enterprise Library but not the same version.

     

    Module A is old an uses Enterprise Library 1.0.

     

    Module B is newer an users Enterprise Library 2.0.

     

    The configuration of 1.0 and 2.0 have changed a lot.

     

    Would it be possible to include both modules in the application without everyting using the same version of Enterprise Library.

     

    (Note: Enterprise Library is just an example - I'm not sure whether they are backwards compatible in those versions)

     

    Hope someone can help.
    Monday, September 17, 2007 9:48 AM

All replies

  • When yoreference an assembley in the GAC, your app/web.config has the specfied version in the config settings, if

    I were you, I would rename one of the DLLs to avoid conflicts.

    Monday, September 17, 2007 10:55 PM
  • Hi LiveToCode.. , thank you for answering my post.

     

    I'm not sure we are talking about the same thing. Enterprise Libarary has certain config that it uses. For example

     

    <enterpriseLibararyConfigSection>

    <cachingApplicationBlock setting="value">

     

    Now version 2 of Enterprise Library might have a non-backwards compatible configration schema.

     

    Lets say:

     

    <enterpriseLibararyConfigSection>

    <cachingApplicationBlock newsetting="value"> (old setting is not there anymore)

     

    Now let's say I have a component that works with the version 1 and expects the old setting and one that works with the version 2 that expects the new setting. Now I want to use both components in one application without having to change one of the components.

     

    Is there any why I can have the application "serve" each assembly with a different config section?

    Tuesday, September 18, 2007 7:20 AM
  • Hi, if you are developing your app from scratch and you forsee such kind of scenario, I would recommend that you do not put your config data in default app config file. Instead have a custom config file whose path you can read from default config. You can associate version with path so that your assemblies with different version numbers load config file from different locations.

     

    http://DotNetWithMe.blogspot.com
    vikas goyal

     

    Tuesday, September 18, 2007 9:55 AM
  • Hi VikasGoyal

     

    Thank you for anwering my post.

     

    You are right. I realize that.

     

    But what if these components are third-party components that you cannot modify? Can you "cheat" them into thinking that their configuration is there? Like specifying that assembly a, b and c must see a certain config or something?

     

    Tuesday, September 18, 2007 10:19 AM
  • As of now i am not aware of any such 'cheat'. may be u can post your query in .NET runtime forum now.

    Pls mark replies as 'Answers' if it helped.

    Tuesday, September 18, 2007 10:32 AM
  • Ah!  This is a more interesting situation than it seems!

     

    You have someting called binder redirection, which you can set for the V1.0 assembly, to use the V2.0 code, assuming V2.0 is backward compatible with V1.0?

     

    If the versions of the component are not compatible, the way around it is to have each application have a local version of the assembly to use directly, instead of utilitising the GAC.

     

    Is that what you're meaning?

     

    Martin Platt.

    Tuesday, September 18, 2007 11:05 PM
  • Thank you.

     

    I will try to ask it in .Net Runtime.

     

     

    Wednesday, September 19, 2007 8:52 AM