Last post Jun 30, 2006 10:49 AM by mnkeyfeetz
Dec 08, 2005 06:09 PM|speedracer|LINK
I just started using VS 2005 for a new project and have hit a problem I never saw using VS2003. I am adding a reference to a managed c++ dll and when I build my web site I get the following error. It is on the very first line of my aspx
Error 2 The specified module could not be found. (Exception from HRESULT: 0x8007007E)
The output tab displays
(0): Build (web): The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Any idea what is causing this? I am stumped.
Jan 23, 2006 01:27 PM|TimMurtaugh|LINK
I too am experiencing this problem. I get this error:
Unable to load DLL 'sx32w.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
sx32w.dll is a native DLL. Here is the declaration in ny VB.NET code:
When I invoke the function, I get the error above. This is a web application in ASP.NET and VB.NET originally developed in VS 2002, just ported ot VS 2005 by the Conversion Wizard. The DLL I'm trying to access is in the Bin subdirectory of
my web application. This worked with VC 2002, but not after conversion to VC 2005.
I've tried copying this DLL to the root directory, and also to the same directory as the vb code that access it. Nothing works.
The DLL can be found if I specify an absolute path to the DLL, but for obvious reasons I don't want to specify an absolute path.
Where does PInvoke look for DLLs?
Jun 27, 2006 04:12 PM|mnkeyfeetz|LINK
------ Build started: Project: X:\...\TheWeb_SVC\, Configuration: Debug .NET ------
Validating Web Site
Building directory '/TheWeb_SVC/App_Code/'.
when I try to build the web service. I've been researching the web for the past few days and have found no useful information out there so I finally joined a forum and decided to post in the hopes that someone has a useful suggestion. Thanks.
Jun 27, 2006 04:47 PM|Mikhail Arkhipov (MSFT)|LINK
This most probably means that dll cannot be loaded. Is it built with .NET 2.0 or 1.1? If the latter, maybe it has a hard requirement to run on 1.1? Assembly may demand specific framework version in the associated manifest or config file.
Jun 28, 2006 05:51 PM|mnkeyfeetz|LINK
doesn't help either.
Jun 29, 2006 09:37 AM|Mikhail Arkhipov (MSFT)|LINK
Blue squiggly line in the file only means that ASP.NET conpilation of the Web failed and VS cannot provide reliable intellisense. Most probably it does not relate to the Global.asax file existence.
Is the specified binary in the bin, GAC or on a network share?
Jun 29, 2006 10:25 AM|mnkeyfeetz|LINK
Jun 29, 2006 01:16 PM|Mikhail Arkhipov (MSFT)|LINK
Sorry, I assumed you knew which assembly could not be loaded.
I think the issue might be that the component may have some dependencies that cannot be resolved during compilation of the Web. Can you run depends.exe on the dll and see what it depends on?
The issue from another reader with sx32w.dll is probably b/c dll cannot be found when CLR attempts to load it using LoadLibrary or LoadLibraryEx. LoadLibrary is Win32 API, it has specific rules how it searches for the dll (see here
http://flounder.com/loadlibrary_explorer.htm) and it knows nothing about ASP.NET or bin folder. By the way, specifying full path is better for security reasons as you always will be loading specific
copy of the binary instead of relying on the search rules. If someone places dll with the same name in a folder that happes to be searched first, you app will break. You don't have to hardcode the path string, you may calculate it from the application installation
path or from data in web.config.
Jun 30, 2006 10:49 AM|mnkeyfeetz|LINK
Thanks, Mikhail. Depends.exe led me to the problematic assembly. Removing that assembly and its references in the code led to me being able to build the project. Now on to fixing the problem.
Thanks for all of your help!
Ashley Stephens (aka mnkeyfeetz)