NDepend has already been mentioned by Jesse (if you are analyzing .NET code), but allows you to explain exactly how this can help.
Is there a program / script that can scan the executable for dependency DLLs or run the program in a "clean" environment without a DLL for testing to prevent such situations?
In the NDepend Project Properties panel, you can determine which application analyzes are collected (in green), and NDepend will display third-party assemblies used by applications (in blue). Provides a list of directories where you can search for applications and third-party assemblies.

If a third-party assembly is not found in these directories, it will be in error mode. For example, if I delete the .NET Fx directory C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319 , I see that third-party .NET Fx assemblies are not allowed:

Disclaimer: I work for NDepend
Patrick from NDepend team Jun 12 '17 at 13:49 on 2017-06-12 13:49
source share