How to find out which dependency is failing to load

I am getting the following error when trying to run a web application:

Exception information: 
    Exception type: ConfigurationErrorsException 
    Exception message: Could not load file or assembly 'Atalasoft.dotImage.AdvancedDocClean.DLL' or one of its dependencies. The specified module could not be found.

I am running on Windows Server 2003 & .NET Framework 4.0. The same binaries and dll’s are running successfully on a Windows Server 2008 R2 server.

How can I find out which dependency is failing to load?

Edit

Fusion logging shows the following:

*** Assembly Binder Log Entry  (4/11/2011 @ 2:37:42 PM) ***

The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.

Assembly manager loaded from:  C:WINDOWSMicrosoft.NETFrameworkv4.0.30319clr.dll
Running under executable  C:WINDOWSSysWOW64inetsrvw3wp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITYNETWORK SERVICE
LOG: DisplayName = Atalasoft.dotImage.AdvancedDocClean
 (Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Atalasoft.dotImage.AdvancedDocClean | Domain ID: 4
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///K:/App/Prd/SEMS/asp/sems/
LOG: Initial PrivatePath = K:AppPrdSEMSaspsemsbin
LOG: Dynamic Base = C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filessemscd484e8d
LOG: Cache Base = C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filessemscd484e8d
LOG: AppName = a29ce80f
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: K:AppPrdSEMSaspsemsweb.config
LOG: Using host configuration file: \?C:WINDOWSmicrosoft.netFrameworkv4.0.30319aspnet.config
LOG: Using machine configuration file from C:WINDOWSMicrosoft.NETFrameworkv4.0.30319configmachine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/sems/cd484e8d/a29ce80f/Atalasoft.dotImage.AdvancedDocClean.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/sems/cd484e8d/a29ce80f/Atalasoft.dotImage.AdvancedDocClean/Atalasoft.dotImage.AdvancedDocClean.DLL.
LOG: Attempting download of new URL file:///K:/App/Prd/SEMS/asp/sems/bin/Atalasoft.dotImage.AdvancedDocClean.DLL.
LOG: Assembly download was successful. Attempting setup of file: K:AppPrdSEMSaspsemsbinAtalasoft.dotImage.AdvancedDocClean.dll
LOG: Entering download cache setup phase.
LOG: Assembly Name is: Atalasoft.dotImage.AdvancedDocClean, Version=9.0.2.43320, Culture=neutral, PublicKeyToken=2b02b46f7326f73b
LOG: A partially-specified assembly bind succeeded from the application directory. Need to re-apply policy.
LOG: Using application configuration file: K:AppPrdSEMSaspsemsweb.config
LOG: Using host configuration file: \?C:WINDOWSmicrosoft.netFrameworkv4.0.30319aspnet.config
LOG: Using machine configuration file from C:WINDOWSMicrosoft.NETFrameworkv4.0.30319configmachine.config.
LOG: Post-policy reference: Atalasoft.dotImage.AdvancedDocClean, Version=9.0.2.43320, Culture=neutral, PublicKeyToken=2b02b46f7326f73b
LOG: GAC Lookup was unsuccessful.
LOG: Binding succeeds. Returns assembly from C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filessemscd484e8da29ce80fassemblydl363ae24d2b8096e5c_94f5cb01Atalasoft.dotImage.AdvancedDocClean.dll.
LOG: Assembly is loaded in default load context.

Edit

Output from CppCodeProvider that failed to load

*** Assembly Binder Log Entry  (4/11/2011 @ 2:37:42 PM) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:WINDOWSMicrosoft.NETFrameworkv4.0.30319clr.dll
Running under executable  C:WINDOWSSysWOW64inetsrvw3wp.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = NT AUTHORITYNETWORK SERVICE
LOG: DisplayName = CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///K:/App/Prd/SEMS/asp/sems/
LOG: Initial PrivatePath = K:AppPrdSEMSaspsemsbin
LOG: Dynamic Base = C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filessemscd484e8d
LOG: Cache Base = C:WINDOWSMicrosoft.NETFrameworkv4.0.30319Temporary ASP.NET Filessemscd484e8d
LOG: AppName = a29ce80f
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: K:AppPrdSEMSaspsemsweb.config
LOG: Using host configuration file: \?C:WINDOWSmicrosoft.netFrameworkv4.0.30319aspnet.config
LOG: Using machine configuration file from C:WINDOWSMicrosoft.NETFrameworkv4.0.30319configmachine.config.
LOG: Post-policy reference: CppCodeProvider, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/sems/cd484e8d/a29ce80f/CppCodeProvider.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/sems/cd484e8d/a29ce80f/CppCodeProvider/CppCodeProvider.DLL.
LOG: Attempting download of new URL file:///K:/App/Prd/SEMS/asp/sems/bin/CppCodeProvider.DLL.
LOG: Attempting download of new URL file:///K:/App/Prd/SEMS/asp/sems/bin/CppCodeProvider/CppCodeProvider.DLL.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/sems/cd484e8d/a29ce80f/CppCodeProvider.EXE.
LOG: Attempting download of new URL file:///C:/WINDOWS/Microsoft.NET/Framework/v4.0.30319/Temporary ASP.NET Files/sems/cd484e8d/a29ce80f/CppCodeProvider/CppCodeProvider.EXE.
LOG: Attempting download of new URL file:///K:/App/Prd/SEMS/asp/sems/bin/CppCodeProvider.EXE.
LOG: Attempting download of new URL file:///K:/App/Prd/SEMS/asp/sems/bin/CppCodeProvider/CppCodeProvider.EXE.
LOG: All probing URLs attempted and failed.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Well, the dependency that seems to be missing is Atalasoft.dotImage.AdvancedDocClean.DLL. When you run this on the 2008 machine, do you know from where this DLL is being loaded? Do you have it locally deployed in the bin directory of the web app, or is it installed somewhere on that machine, or installed in the GAC?

Another thing to verify is that you’re running the same version of .NET on both machines. If the 2008 machine is running .NET 4, and the 2003 machine is not, you may not be loading the same DLLs.

A useful tool for debugging assembly loading problems is Fusion. Fusion logging comes with .NET, you just need to enable it, and use the Fusion Log Viewer:

http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx

Method 2

I see a lot of reference to
http://msdn.microsoft.com/en-us/library/e74a18c4(VS.71).aspx

But remember that is .NET 1.1 version and it has the ASP.NET radio button. On the new fusion log you don’t have the ASP.NET radio button.

I haven’t seen the documentation on how to use the Fusion Log with ASP.NET. Registry key change is an option I see everywhere, but are there any documentation for version 4.0?

Does anyone know?


UPDATE : I found the solution here. I guess, I broke down and started working on the registry.

HKEY_LOCAL_MACHINESOFTWAREMicrosoftFusion

Add:

DWORD ForceLog set value to 1
DWORD LogFailures set value to 1

DWORD LogResourceBinds set value to 1

String LogPath set value to folder for logs ie) C:FusionLog

Method 3

I suggest checking out the documentation on Fusion logs here

Unfortunately the error could indicate an issue with dependencies of the dll you’re trying to load, and if logging is enabled you should be able to see exactly which one this is. Note that a dependency loaded into the loading application is not sufficient for giving a dll access to it in all cases (if they do not share the same application domain). I had some problems with this trying to make plugins with their own application domain at one point

Method 4

I think that means that it’s DLL is not in your application’s bin folder. Try grabbing the assembly’s DLL and manually placing it into that folder.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x