Assembly Names and Versions

What is considered best practice when it comes to assemblies and releases?

I would like to be able to refer to several versions of the same library - the solution contains several projects that depend on different versions of the commonutils.dll library that we create ourselves.

Since all dependencies are copied to bin / debug or bin / release, there can only exist one copy of commonutils.dll, despite each of the DLL files having different version numbers of the assembly.

Do I have to include version numbers in the assembly name to be able to reference multiple versions of the library, or is there another way?

+3
source share
3 answers

This is what I live

, DLL. :

  • . EXE DLL , . , , -, .

  • . , , . (Assembly.Load). , .

: . , , / ? , , , , . , , .

Visual Studio , , .

- . , , false.

, , , . ( - ) . , , , , .

, Assembly.Load, , . Assembly.GetType . , (, ), AmbiguousMatchException . , , Assembly.GetType.

+1

GAC (Global Assembly Cache), , . .NET Framework . , , GAC, .

. , "" .

+3

, , .

If your assembly (commonutils.dll) has a strong name (i.e. is signed), you can think about installing it in the GAC (Global Assembly Cache), you can install different versions of the same assembly side by side in the GAC), therefore, the calling application automatically receives the correct version because the .NET types include assembly version information.

In your VS project, you reference the correct version of the library, but do not deploy it in the application folder; you install it in the GAC (during application installation).

0
source

Source: https://habr.com/ru/post/1697128/


All Articles