Solution to Visual Studio 2008 Error: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

This blog-post documents the process involved in solving a strange problem in Microsoft Visual Studio 2008.

Before I go on to describe the process, I’ll I give you the solution that worked for me, a system DLL called MSVCR71.DLL was missing from the computer that had the problem, copying MSVCR71.DLL from a computer that didn’t have the problem, solved it.

When I say “worked for me”, it means that it might not work for you, but the problem is likely to be caused by another missing DLL.

Frustration
For days I was struggling with an error that meant that I couldn’t debug web-applications from Visual Studio 2008, if I tried to debug a web-application, it would simple show a stack-dump that stated:

The specified module could not be found. (Exception from HRESULT: 0x8007007E)

What made it even more strange, was that we had a completely identical computer, in terms of hardware and operating system (Windows 7 64-bit), that didn’t show this behaviour.

The most wonderful thing about the error was that it stated that a specified module could not be loaded, but it didn’t tell me which? Great!

Google to the rescue? Not really! Since this is a very generic error, and a lot of people seem to be experiencing it, and I couldn’t see any pattern in the answers people came up with.

First I tried to reinstall Visual Studio 2008, and, as I expected, that changed nothing.

From Google the evidence was piling up, some file(s) was missing, but why was it working on the other computer.

I clearly needed the help from some tool A tool called “Dependency Walker” (http://www.dependencywalker.com/) was suggested, and it told me that I was missing the files GPSVC.dll and IEShims.dll, but both files were present on the system. GPSVC.dll in a 64-bit version though, IEShims.dll was present in both a 32-bit and a 64-bit version.

After strugling with this problem, looking for 32-bit version of the DLLs, I came to the conclusion that “Dependency Walker” was showing false positives, the two files seems to be hidden, at least when using the method of inspection that “Dependency Walker” uses. “Dependency Walker” might be useful to locate missing dependencies of other files, so I’ll keep it in my arsenal of tools, for this particular problem, it sent me looking in the wrong direction though.

Process Monitor
My next idea centered around the fact that a file was missing (DOH ;-) ). I knew of a utility that can monitor file-system access, I just couldn’t remember the name, and Google wasn’t immediately helpful, eventually I found a mention of “Process Monitor” (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx), and that seemed to be what I was looking for.

“Process Monitor” shows that there’s a lot going on, so I started experimenting with the filters, the easiest way to configure a filter is to right click on a message that looks irelevant, and then select “Exclude”, the right click is context sensitive to the column you’re clicking on.

I quickly focused on the events with the Result: “PATH NOT FOUND” and since I was looking for file-system access, I excluded all events where the Operation was begining with “Reg”, meaning a Registry access.

I suggest that you look for attempts to load a file by traversing the “PATH” environment.

Solution found: MSCVR71.DLL was missing
There was a lot of activity going on, but ended up focusing on a particular file: MSCVR71.DLL, and it was indeed missing

This screen-shot from Process Monitor highlights the problem when the MSVCR71.DLL file is missing:

Processmonitor Partial Screenshot

After I copied the MSVCR71.DLL file to a location where it could be found by Visual Studio, the problem disappeared.

So why didn’t we see the error on other computers, with a seemingly similar configuration? It’s because the MSVCR71.DLL is distributed with several other software packages, and on the computer where Visual Studio 2008 worked, MSVCR71.DLL was installed with two packages: “Java Runtime Environment JRE6″ and “DropBox”, and the installers had added these to the PATH environment variable. Since these packages might be found on many developer-machines, this could explain why this problem is not showing up more often.

BTW: Now that I know the solution, it is, of course, very easy to find a post that gives the solution DOTNET Spider: .NET Error: the specified module could not be found. (Exception from HRESULT: 0x8007007E). Number one hit when Googling for “The specified module could not be found” msvcr71.dll.

External links

2 Responses to “Solution to Visual Studio 2008 Error: The specified module could not be found. (Exception from HRESULT: 0x8007007E)”

  1. Thomas Stabell Says:

    This is why I dont like Windows. The DLL hell.

  2. Kim Says:

    Agreed, DLLs were born in a time of constrained systems, and Microsoft never managed to deliver the distributed vision of it (aka Cairo), with rich APIs and duplicate code DLL hell is, mostly, a thing of the past, at least with serverbased Windows software. .NET is a very well-engineered piece of kit

Leave a Reply