Referencing different versions of the same assembly

前端 未结 5 1410
忘了有多久
忘了有多久 2020-12-08 19:45

If A references assembly B 1.1 and C, and C references B 1.2, how do you avoid assembly conflicts?

I nievely assumed C\'s references would be encapsulated away and w

5条回答
  •  眼角桃花
    2020-12-08 20:25

    The .NET runtime is perfectly capable of loading multiple versions of the same assembly simultaneously. If you are going to open this can of worms, however, I strongly suggest you stronly name your assemblies and use the Major.Minor.* naming scheme to avoid naming conflicts.

    I don't think you should think of a one-size-fits-all approach to using (or not) the GAC. The GAC can be really nice if you want to automagically use new functionality published with future versions of a DLL. Of course, this blessing comes at a cost that new versions might not work exactly like you expect them too :). It's all a matter of what's most practical, and how much control you have over what gets published to the GAC.

    Regards, -Alan.

提交回复
热议问题