Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled Exception: System.Exception: Could not load dbgeng.dll on Win7. #38

Open
ebtaleb opened this issue Sep 13, 2018 · 2 comments
Open

Comments

@ebtaleb
Copy link

ebtaleb commented Sep 13, 2018

When running the latest binary release, on Windows 7 Pro SP1, both x86 and x64 version, I get the following error:

$ ./DbgShell.exe

Unhandled Exception: System.Exception: Could not load dbgeng.dll.
at MS.DbgShell.MainClass._NormalModeMainWrapper(String[] args) in C:\src\DbgShell\DbgShell\MainClass.cs:line 467
at MS.DbgShell.MainClass.Main(String[] args) in C:\src\DbgShell\DbgShell\MainClass.cs:line 130

So I look at the incriminating code:

              string pathToDbgEng = Path.Combine( rootDir, "Debugger", "dbgeng.dll" );

            IntPtr hDbgEng = NativeMethods.LoadLibraryEx( pathToDbgEng,
                                                          IntPtr.Zero,
                                                          LoadLibraryExFlags.LOAD_WITH_ALTERED_SEARCH_PATH );
            if( IntPtr.Zero == hDbgEng )
                throw new Exception( "Could not load dbgeng.dll." );

The file is indeed in the Debugger folder, yet the error persists.
I have tried to replace the file with the one from my WinDbg installation, but to no avail.

Is there something that I could have missed? Thanks.

@jazzdelightsme
Copy link
Member

No, I don't think it is something you missed; sounds like a legit bug. I have not tested on Win7 in... a long time. I bet it is some missing dependency. I'll have to spin up a Win7 VM to figure out what it is.

In the meantime, something you can try is to load DbgShell from windbg. I.e. if you are looking at a dump file, for example, load it up in windbg (C:\Debuggers\windbg.exe -z C:\path\to\dump.dmp), then load the DbgShell extension (.load C:\Tools\DbgShell\x64\dbgshellext.dll), then you should be able to run !dbgshell and hopefully a DbgShell window pops up (which is using the already-loaded dbgeng.dll in the windbg process).

Then again, I have not tested on Win7... so maybe there will be other problems.

Just curious, what version of PowerShell do you have?

@jazzdelightsme jazzdelightsme changed the title Unhandled Exception: System.Exception: Could not load dbgeng.dll. Unhandled Exception: System.Exception: Could not load dbgeng.dll on Win7. Sep 13, 2018
@ebtaleb
Copy link
Author

ebtaleb commented Sep 19, 2018

Ok, I tried to load DbgShell from WinDbg by opening an executable. I get the following errors, depending on the version of WinDbg and DbgShellExt:

0:000> .load C:\Users\mu\Desktop\FLEGGO\dbs\dbg\DbgShell\DbgShell\x86\dbgshellext.dll
The call to LoadLibrary(C:\Users\mu\Desktop\FLEGGO\dbs\dbg\DbgShell\DbgShell\x86\dbgshellext.dll) failed, Win32 error 0n193
"%1 is not a valid Win32 application."
Please check your debugger configuration and/or network access.

0:000> .load C:\Users\mu\Desktop\FLEGGO\dbs\dbg\DbgShell\DbgShell\x64\DbgShellExt.dll
The call to LoadLibrary(C:\Users\mu\Desktop\FLEGGO\dbs\dbg\DbgShell\DbgShell\x64\DbgShellExt.dll) failed, Win32 error 0n126
"The specified module could not be found."
Please check your debugger configuration and/or network access.

As for the PowerShell version:

PS C:\Users\mu> $PSVersionTable.PSVersion

Major Minor Build Revision


5 1 14409 1005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants