3

I've most commonly heard ilmerge being used as a way to merge a bunch of dlls into a single executable file, to aid distribution of desktop applications.

Is it also viable to use it as a way to enforce dependency chains in a class library?

For example, assuming I have three components:

* dllA
* dllB
* dllC

whose dependency chains are:

* dllA -> dllC
* dllA -> dllB
* dllB -> dllC

Now if dllC is rev'd to a new version v1 to v2, is it possible for dllA to be forced to use dllC_v1 while dllB is forced to use dllC_v2?

* dllA -> dllC_v1 
    (dllC_v1 is ilmerged into dllA)

* dllA -> dllB -> dllC_v2
    (dllC_v2 is ilmerged into dllB)

Also, how does versioning configuration work in this scenario? If dllC relies on a config section to be defined in web/app.config, and it's expectation of config schema/keys differs between dllC_v1 and dllC_v2, what happens then?

Martin Suchanek
  • 3,006
  • 6
  • 31
  • 31
  • No, dllC simply doesn't exist anymore. It is as if you created a project that merged all of the source code of the three original projects. – Hans Passant Apr 07 '14 at 20:18
  • @HansPassant but what if I use `/internalize`? Can't I internalize `dllC_v1` into `dllA` and `dllC_v2` into `dllB`? – Martin Suchanek Apr 08 '14 at 09:42
  • I found this http://www.meedios.com/EN/forum/viewtopic.php?f=27&t=3221 where it says one way to do this is to just have two dlls named based on their version: `dllC_v1` and `dllC_v2`, and then reference each specifically from `dllA` and `dllB`? The trick with the different names is so that when they are copied to the `/bin` folder they won't clash or overwrite one another (a problem which doesn't exist in the GAC, which supports side by side versions). – Martin Suchanek Apr 08 '14 at 09:56
  • This link: http://leecampbell.blogspot.ca/2011/06/isolating-custom-library-dependencies.html suggests another alternative, which is to add dll references as embedded resources? – Martin Suchanek Apr 08 '14 at 09:57
  • Related: http://stackoverflow.com/questions/11335577/transitive-dependency-causing-conflicting-version-of-same-dll?rq=1 – Martin Suchanek Apr 08 '14 at 10:07
  • Related: http://stackoverflow.com/questions/2460542/using-different-versions-of-the-same-assembly-in-the-same-folder?lq=1 – Martin Suchanek Apr 08 '14 at 10:27

0 Answers0