We occasionally get requests for the ability to break when a module loads. WinDbg (the other debugger that Microsoft produces) exposes this as an exception (see the 'sx' command), although it isn't really an exception. Ideally, I think this should be a special kind of breakpoint.
VS doesn't support this as a first class feature, but as long as you know what module you want to break on, this is very easy to do. I will give you two possible ways to do this:
Just set a function breakpoint on the DllMain function of the module in question (or _DllMainCRTStartup if you prefer). To do this:
If you don't have symbols for the dll in question, this is more difficult. Do this:
If the dll is also reloacted, then instead you will need to add the first number (1AE60 in the example) to the address where the module will load
This won't work with '/noentry' dlls. This also may not work if you have dlls with circular references. In either case, use the registry.