Reviving Dependency Walker

If you haven’t noticed, I am a big fan of reviving the fanfare of some of the older development tools that are out there. Of course, there are constantly new tools released to help developers work smarter, faster, and more effectively – but often with all of the excitement over these new tools we forget about old standbys.

Dependency Walker is a tool that when you need it, you really need it. The fact that it is a free, lightweight download which doesn’t require an install to run is just added bonus.

The DLL Problem

We use a third-party DLL in our primary project at work which interacts with Progress. The problem is on a fresh system install and run, you receive the following error:

Could not load file or assembly or one of its dependencies

The dreaded “Could not load file or assembly or one of its dependencies.” The key here is the dependencies portion. I know the Progress.ssl.dll exists and is in the right directory, it compiles correctly, but a dependency inside this DLL is affecting the runtime execution.

How do I know what the dependency is?

Dependency Walker to the Rescue

First, we need to download Dependency Walker – go here:

Download Dependency Walker

Pick the appropriate version for your OS and take in the great retro-vibe of the website; it shows a little age doesn’t it!

After the download, simply unzip it to any directory on your computer and run depends.exe. Next, open the DLL that you are struggling with (Progress.ssl.dll in my case).

Dependency Walker Inspect DLL

Notice, the popup message and the yellow question marks next to DLL’s which have potential problems. In this particular case, MSVCR71.DLL is the culprit and needed to be copied into a directory in system path.

Here is another screenshot of the error for the DLL’s:

Dependency Walker Error Dependencies

After you’ve attempted to resolve the issue (and this may be different each time based on the particular scenario), refresh Dependency Walker to see if the dependent DLL is corrected or simply try your .NET project again and see if it works properly. In my case, MSVCR71.DLL was all that was needed and we were back on track.

If you have other “tried and true” tools that you still use today, please add them to the comments so we can keep them alive and maybe help a developer out!

Running Zune and WP7 on VirtualBox

I have a fairly unique machine I develop on. I run Ubuntu as my host environment, and run development and office work off of virtual machines through VirtualBox with Windows 7. You may thinks it is a bit crazy but it has some real advantages if you have the patience to work through some of the nuances.

Ubuntu runs around 400 megs of RAM for the host, which compared to Windows 7 is insanely low; it’s quick, light, and stable. My virtual machines perform extremely well on the excess RAM (4 to 8 gigs) per VM and I readily create snapshots whenever installing new software or backing up my system(s). Additionally, I can run dedicated servers as VM’s to test enterprise applications without involving our internal networking resources until we’re ready to deploy to a test/staging environment.

With all of this being said, there are a few things that can drive you crazy; namely, Windows Phone 7 and Zune.

WP7 in VirtualBox

There are several articles on the Internet which discuss how VirtualBox and USB devices work, but here is the cliff-notes version:

USB devices can only be used by either the host or a client VM at any one time. Therefore, to use a USB device (such as WP7), you need to enable it from the VirtualBox Devices drop down (Devices > USB Devices > Unknown Device). Most likely, your device will be displayed as an Unknown Device.

Go ahead and select the device so that it now displays a checkbox next to the device. This should be enough to auto-start the Windows device driver installation which will most likely fail. You can open Device Manager to view the driver which should now be labeled USB Composite Device.

Windows Device Manager Screenshot

The reason this has failed is because by default, VirtualBox does not enable USB 2.0 (EHCI) Controller. You can enable this by opening the Settings for the VM you would like to connect your WP7 to, and selecting the USB tab on the left side. This will allow you to check the appropriate checkbox as seen in the following screenshot:

VirtualBox Enable USB 2.0 Screenshot

If you start the VM from this point you will most likely see the following error:

Oracle VM VirtualBox Extension Pack Required Screenshot

No worries, we simply need to install the Oracle VM VirtualBox Extension Pack to enable USB 2.0 support. I did pause to wonder why you have the ability to select Enable 2.0 USB within the out of the box application, yet it fails at the point of running the VM. It seems this warning could occur as soon as you select the checkbox or simply include the extension pack installation when selecting the checkbox to begin with. Regardless, you can download the extension pack from Oracle ( which should look similar to the following screenshot.)

Download VirtualBox Extension Pack Screenshot

After downloading, simply double click the file and you should receive the following prompt:

Install VirtualBox Extension Pack Screenshot

Once you have finished installing, run the VM and select the USB device again. This time, Windows will auto-install the device driver properly and you should receive the following success screen:

Windows Device Auto-Installation Success Screenshot

This may also auto-load Zune and attempt to sync your data for this VM. After completion you should be able to manage content on your phone just as you would a physical installation. Have fun, even busy coders need a bit of music to get through the day!

Running SSMS Under Another Windows Authenticated User

Why do this?

Recently, I’ve been using Ubuntu as a host operating system and running virtual machines for my various development and sandbox server environments. This has led me to not particular want to register all of my client VM’s with our work domain and just pass my credentials when needed. For most applications this works fine; however, with SQL Server Management Studio to login to databases with Windows Authentication it appears you can only use the currently logged in user rather than prompting for credentials.

Can you do this for other applications?

Absolutely, this is basic functionality in the OS; however, since most applications simply prompt for AD credentials instead of binding you to the current logged in local user account, it’s less common than you would think.

Here is the command line:

runas /netonly /user:[domain]\[username] "[ssms_exe_path]"

For example:

runas /netonly /user:workdomain\nbarger "C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe"

P.S. – you can also add this to your Target in the property window of any SSMS icon for convenience.