Assembly Loading issues are difficult to debug because there are at least two layers to this when dealing with Managed and Native code.
- When an executable is started the native loader must find the file, load it into memory along with all the dependent DLLs to make it run.
- The native loader looks into the assembly manifest to determine this information and then simply hunts down all the DLLs and load them into memory (in order).
- You can easily see this process using WINDBG and pointing to an EXE and running it from Windbg. The list of modules being loaded is the native loader at work.
- If a dependency is a .NET managed code assembly then the native loader transfers the loading request directly to the managed loader, known as "Fusion".
- You can easily set up the FusionLOG viewer to see what is happening http://msdn.microsoft.com/en-us/library/vstudio/e74a18c4%28v=vs.100%29.aspx
- Failures of loading at either the managed layer or within the managed layer are easily spotted either through WINDBG for Native or the Fusion Log View for Managed code.
A few hints on Managed DLL loading: If an assembly holds a reference to a dll that is not included in that assembly, there is a strict order of "probing" which is followed to find the dll. There will be a minimum of three attempts to find the DLLs in different places such as in the assembly, in the program root path and in the GAC. If the three attempts fail, loading is stopped at that point and the program will not run. When this happens it is often considered a system level environmental issue; however, in reality it's a programming issue because unless pre-requisites are fully know by the system administrator there is no way they can guess at this stuff. If you are a programmer who is including other dependent dlls you should always consider whether or not to place them into the assembly to stop this problem. Otherwise you, the system admins, and folks using your program will have to wait until the root cause is determined which takes a long time.
You may say, well I was told by another department to use this dll and I have no idea what the other dependencies are! This is no excuse, as there are excellent tools such as ILDASM and even managed code Dependency walkers that will tell you everything that's needed. The best way to package these "other" dlls is to simply include them in your assembly.
msiexec /i "MyVSTOOutlookInstaller.msi" /l*v "log.log"
- please update your question with this extra info. – Molokai!Analyze
on the dump could give you clues as to the module where the first/second chance exception occurred. Thats what I was asking, how can you WinDBG a crash of an installer without the private symbols, but delve into the dump is a valid point – Molokai!CLRStack
and follow the call stack to show the OP the smoking gun. You dont even care about the method bodies. btw I'm pretty sure msiexec is UNmanaged so SOS isnt going to help. But I do see now how you could get a rough idea of whats breaking during the install using WinDBG :) And you're right without the logs we're all guessing here!! – Molokai