views:

344

answers:

3

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?

A: 

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/

Coxy
Dependency Walker is not very useful with .Net assemblies
Frank Bollack
Yes, great for unmanaged but not for .NET.
GraemeF
+2  A: 

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.

Simon P Stevens
My application is built with MSBuild by CCNET which also runs automated acceptance tests but doesn't currently test the installer. I suppose that would be one approach to catch the problem as early as possible, but I'm specifically asking for help with finding what the problem is when it has already occurred.
GraemeF
So your not after something that stops it happening, but after something that tells you which .dll was missing when the app crashes on a client machine?
Simon P Stevens
Yes, well, on a test machine first, hopefully! ;)
GraemeF
Ahh, I misunderstood the question the first time then. See the edit I made re fuslogvw.
Simon P Stevens
I was aware of fuslogvw but I was hoping for something that was a little easier to use. Oh well! Thanks.
GraemeF
A: 

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.

Frank Bollack
I'm using WiX, and explicitly listing the files to be included.
GraemeF
I'm not aware of any WiX tools that may help you, so you might want to stick with my suggestion to simply pick up all files from the output directory. That the easiest I can think of. If the project runs from the output directory, it also should after installing at the target machine.
Frank Bollack