Confused about version numbers of links in my .NET application

I have a .NET project that references a DLL called ABCPDF. The version number used when writing the application is 7.0.2.3, and the application was deployed to an intermediate server.

The software version on the intermediate server is 7.0.2.8, and the application is interrupted, stating that it cannot find version 7.0.2.3

Of course, it should use the version of the DLL version 7.0.2.8 instead of requiring you to recompile using 7.0.2.8 on my development machine? If I updated the ABCPDF version on live servers in 6 months, it would break every application using the previous version if I did not know.

Am I getting the wrong stick end here?

+4
source share
2 answers

You may consider redirecting assembly bindings, see below code:

<runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="Your.Assembly" publicKeyToken="your token here"/> <bindingRedirect oldVersion="7.0.2.3" newVersion="7.0.2.8"/> </dependentAssembly> </assemblyBinding> </runtime> 

Just put this piece of code in your App.Config file

+3
source

Right-click the link and click Properties.

In the link properties, set the Specific Version option to false.

While this may cause problems, if ABCPDF breaks backward compatibility, if they do not, it will solve your problem.

Edit: Not applicable if you use signed assemblies, see another answer. It was not known about the signing of ABCPDF.

0
source

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


All Articles