Force application to use a specific dll version

I have an application that should use a dll (also written by me) that has been independently verified by a government agency. We plan very rarely to modify the dll due to the re-verification that will be required. I want to prevent inadvertent modifications to this DLL that was received by my application. Is there a way to create a hash code for the dll and configure my application only to use this particular version.

Thus, if someone changed a piece of code for the dll, when we create and run the application, the application will not be able to load the DLL (because it has changed).

Any ideas / suggestions?

Greetings

James

+3
source share
3 answers

Using Strong Names does some of this and prevents someone else from faking your assembly, but does not stop you from doing it by accident, and then resigns.

We use an independent process to launch our main application. Before starting the main application, start the MD5 application with all the assmeblies and compare them with the list of those that it expects to see, if something has changed, MD5 failed and the main application is not loaded.

If you really need a compile-time check, you could probably write a pre-build step that did the same MD5 comparison and couldn't build the assembly if it changed.

+4
source

, dll Reference , " " "", , ?

+2

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


All Articles