How do I find out which missing DLL is making my .

2019-04-26 09:26发布

问题:

When dependencies on 3rd party assemblies are added to a typical .NET application it's very easy to forget to add them to the installer. This problem tends to reveal itself only after the application is installed, and in the form of a crash on startup with little helpful information readily available.

What are the best tools and techniques to find out which assemblies need to be added to the installer?

回答1:

Fully automated builds help reduce the human component and therefore the error. If it's automatically built every time, you know every build will be the same, so once you have it working once, it's always going to work.

We use tools like MSBuild and CruiseControl.net

If you're looking for tools that help your work out the cause of the crash, take a log at the Assembly binding (Fusion) log viewer (or fuslogvw). If you start it up before you start your app, set the log file location and turn full logging on it will report any attempts to bind assemblies, and list any failures.



回答2:

Dependency Walker is a great little utility that follows a chain of dependencies from an application or DLL and highlights any that are missing. It's not really that intuitive for an end user to have to use, but hopefully if you start using it then you'll catch any missing items yourself.

http://www.dependencywalker.com/



回答3:

Depends on the capabilities of your installer. The VS integrated setup projects can automatically pick up any dependent assemblies. You might want to check if your installer has some similar features.

On the other hand you could instruct your VS projects to copy all dependencies to the output directory and simply include all files from there into your installer.