How to process new versions of third-party .Net assemblies without recompilation?

I have some projects that rely on external .Net assemblies to work. They are installed externally from my program, so I have no direct control over which version is used. In addition, updates are expected to be installed for granted.

For example, in one case, I am referring to hardware devices that provide a .Net interface for controlling it. When the user initially installs the device, he installs the driver, which is included. This driver, when I wrote the program, may have been 3.0.4.0. The latest version may be 3.1.8.0.

My program cannot load the assembly when this happens, complaining that the manifest definition is incorrect. A specific exception message is shown below.

Another example is a labeling program. They provide a .Net interface that allows my program to print tags through its system. Installing an updated version of the program is fatal.

Here is a specific error message:

Could not load file or assembly 'SDK.NET.Interface, Version=17.1.0.0,
Culture=neutral, PublicKeyToken=865eaf3445b2ea56' or one of its
dependencies. The located assembly manifest definition does not match
the assembly reference.

If I install this version of the application on my computer, then I refer to the updated version of the assembly and compilation, Im good to go., Bye.

But, it is only a matter of time before I become a problem again.

Ive tried to set the property of Specific Versionreference assemblers to False, but this did not affect the problem.

What is the correct way to solve the problem?

+4
1
+1

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


All Articles