A WinForm. NET program written some time ago. Because many library files have been referenced, but these library files have recently corrected some bugs and algorithms. However, the main program file has not been changed. So it is not like re-compiling the main program. So we copied all the new DLL files to the running directory and hoped that the main program could directly call the new library files. It turns out that these database files are signed by Strong Name. An error occurs when the main program is called, indicating that files of this version cannot be found.
Later, I checked MSDN and found that you only need to add the runtime node to config.
<Runtime>
<AssemblyBinding xmlns = "urn: schemas-microsoft-com: asm. v1">
<DependentAssembly>
<AssemblyIdentity name = "MyAssembly"
PublicKeyToken = "2b7c3a3291de04"
Culture = "neutral"/>
<BindingRedirect oldVersion = "3.0.0.8"
NewVersion = "4.1.0.0"/>
</DependentAssembly>
</AssemblyBinding>
</Runtime>
However, the premise is that the PublicKeyToken of the two DLL is the same, that is, the signature of the same sn file is required.
Of course, if your library file does not use the Strong Name signature at all, you do not need to consider the version issue.