简体   繁体   中英

How do I find out which missing DLL is making my .NET application crash on startup?

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?

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.

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/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM