Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
195 views
in Technique[技术] by (71.8m points)

c# - the specified module could not be found 0x8007007E

Inside the constructor of a Form when I am stepping through my code, a method declared in the very same form is called. Before I can step inside the method, I get a System.IO.FileNotFoundException with message "The specified module could not be found. (Exception from HRESULT: 0x8007007E)". The member method I try to enter is declared unsafe because it deals with unmanaged C++ code, but like I said I can never step into the method anyways.

Since it sounds like a DLL dependency issue, I ran Dependency Walker. Dependency walker only shows problems with MPR.DLL under SHLWAPI.DLL. The problem method is WNetRestoreConnectionA which I never call. The dependency walker FAQ suggests that this is not a problem http://dependencywalker.com/faq.html. Also, this is not a web application or anything. I am unfortunately stuck with VS2005.

What are some possible reasons for this problem to occur? Any ideas on what I could be missing or how I could debug this problem?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Are you running dependency walker in profiling mode, or just static analysis? Profiling mode is what you need for this I think. But there are better solutions I believe.

You could try SysInternals ProcMon. This will allow you to see what file it is trying to load at least, and from there you might be able to figure out what the problem is.

My advice would be to fire it up, then turn off logging. Get to the point where the exception is about to happen, reenable logging, step over in the debugger so the error is generated, then disable logging again. This will leave you with only a small amount of log to deal with, otherwise it can get quite unwieldly quite quickly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...