Debugging Assembly Loading Failures
So...you're seeing a FileNotFoundException, FileLoadException, BadImageFormatException or you suspect an assembly loading failure? Try the steps below to start your debugging process.
First, get the Message property from the exception. If the exception's InnerException property is set, get the Message property from that. If the message is generic, also get the hresult by calling System.Runtime.InteropServices.Marshal.GetHRForException(), passing in the Exception object. If that info is not readily available, you may need to attach a debugger and set it to catch managed exceptions. Then, get the hresult by retrieving the private _HResult field of the managed Exception object.
Retrieving the Fusion log
If the exception message isn t enough for you to determine what the problem is, try getting the Fusion log. It will describe the binding failure (if this is due to an assembly binding failure, instead of a loading failure after the file is found). The exception may already include the log. If not, to get it, run fuslogvw.exe. If you don't have fuslogvw.exe already, install the Framework SDK.
- For pre-v2.0: click on "Log Failures." If this is an ASP.NET or .NET Windows service app, select the Custom option and using regedit, set [HKLM\Software\Microsoft\Fusion\LogPath] to point to an existing directory (like c:\mylogs, not c:\). If you need to log all binds, not just failing ones, set [HKLM\Software\Microsoft\Fusion\ForceLog] as a DWORD value to 1.
- For v2: click on "Settings," then choose "Log bind failures to disk" if you only care about the failures or "Log all binds to disk" if you want to see all binding requests.
- To turn on failure logging during a test run instead of by hand, have your script set [HKLM\Software\Microsoft\Fusion\LogFailures] as a DWORD value to 1 using regedit.
Then, click "OK." Now, re-run the process. Next, click "Refresh" in fuslogvw, and a line should appear for each binding failure (or for each bind, if ForceLog is set). Now, double-click on the line in the "Application" column for the interesting bind, and a web page should come up with the Fusion log.
If the file was found, it was loaded from the last path probed in the log (or from the GAC, if there is no probed path shown).
Note: Unless you are explicitly debugging the failure of a resource to load, you will likely want to ignore failures to find assemblies with the ".resources" extension with the culture set to something other than "neutral". Those are expected failures when the ResourceManager is probing for satellite assemblies.
Troubleshooting Fusion logging
Keep in mind that there may not be any entries if there were no binds or if there were no binding failures (when logging failures only). (And don't forget to restart your application's process after changing logging settings.) If there are not as many entries as you expect, you may need to clear your download cache to make room for them. To do that, in Internet Explorer, choose “Tools“, “Internet Options“, “Delete Files”, “OK“, then re-run your app and finally click “Refresh“ again in fuslogvw.
There is only one Fusion log saved per display name/codebase. So, if the same exact reference is requested twice in the same process, it will only show up once in fuslogvw. To see the duplicate logs, you'll need to stop execution (for example, with breakpoints in your debugger) and then get the log at that time.
For FileNotFoundException:
At the bottom of the log will be the paths that Fusion tried probing for this assembly. If this was a load by path (as in Assembly.LoadFrom()), there will be just one path, and your assembly will need to be there to be found. Otherwise, your assembly will need to be on one of the probing paths listed or in the GAC if it's to be found.
You may also get this exception if an unmanaged dependency or internal module of the assembly failed to load. Try running depends.exe on the file to verify that unmanaged dependencies can be loaded. Note that if you re using ASP.NET, the PATH environment variable it's using may differ from the one the command line uses. If all of them could be loaded, try ildasm.exe on the file, double-click on "MANIFEST" and look for ".file" entries. Each of those files will need to be in the same directory as the manifest-containing file.
For BadImageFormatException:
Try running peverify.exe on the file. That will give a more specific description about why it s considered a bad image. Keep in mind that modules built against v2 can not be loaded by a pre-v2 CLR.
For SecurityException:
You need Execute permission for loading any assembly. Also, if a codebase was used to load this file, you would need both FileIOPermission.Read and FileIOPermission.PathDiscovery or else WebPermission to the location (depending on whether this is a local file or a URL). Try caspol.exe to check your managed security settings.
For FileLoadException:
For an "Access is denied" message (for hresult E_ACCESSDENIED, 0x80070005):
Run tlist -m on the file to see if another process has the file locked and without share-read access. If not, check the ACLs for the file and its dependencies (especially if you're using impersonation).
For a "The located assembly's manifest definition with name [yourAssembly] does not match the assembly reference" message (for hresult FUSION_E_REF_DEF_MISMATCH, 0x80131040):
The Fusion log will say which part of the assembly reference failed to match what was found. It will be the assembly name, culture, public key (or token) or version (if the found assembly was strongly-named).
For "Unverifiable image [yourAssembly] can not be run" or "Can not run executable [yourAssembly] because it contains relocations" messages (for hresult COR_E_FIXUPSINEXE, 0x80131019):
That image must be run as the process exe or else be compiled as a dll. This is because MC++ has made optimizations for you in your image, based on the assumption that it will be the process exe. If it's not the process exe, it won t be loaded at the expected location, so the assumed offsets will be incorrect. When the CLR sees such a file loaded as a non-process exe, it will reject the load.
Comments
Anonymous
June 13, 2003
Not related in any way to this specific post, Suzanne, but Welcome to the house! Have fun, and will look forward to reading your posts! :)Anonymous
August 15, 2003
We I load a newly complied DLL for an ASP.NET application on the server the below is my problem. Do you know how to fix it?For a “The located assembly's manifest definition with name [yourAssembly] does not match the assembly reference" message (for hresult FUSION_E_REF_DEF_MISMATCH, 0x80131040): The Fusion log will say which part of the assembly reference failed to match what was found. It will be the assembly name, culture, public key (or token), or version (if the found assembly was strongly-named).Anonymous
August 18, 2003
Robert: Yes, either change the reference so it matches the found assembly, or copy over the right assembly which matches the reference, so that it will be found instead. For example, if the Fusion log says that the version doesn't match, check against the found assembly's version. In that case, probably the problem is that you've recompiled that assembly with another version. So, then, you may want to update the referencing assembly so that it matches the new version, use config to redirect to the new version, or just not change assembly verson numbers between non-shipping builds (see http://blogs.msdn.com/suzcook/archive/2003/05/29/57148.aspx ).Anonymous
October 01, 2003
The comment has been removedAnonymous
October 02, 2003
From winerror.h:// Access is denied.#define ERROR_ACCESS_DENIED 5LSee my original blog entry for debugging advice about this specific hresult. See http://blogs.gotdotnet.com/alanshi/PermaLink.aspx/d3b8c7d9-b0c6-47fd-8ddf-20db971ba80d for more info about how Fusion has implemented the download cache.Anonymous
November 07, 2003
Suzanne,I have read a number of you rposts regarding using the fusion log to debug assembly loading issues, but I just can't get past this, and am hoping you may be able to shed a little light. This issue is regarding using the Microsoft.ApplicationBlocks.ExceptionManagement from the GAC for an ASP.NET application. My CustomPublisher is also in the GAC. I have a windows service that uses the same exception publishing assemblies, and it works beautifully. For whatever reason though, the ASP.NET application always fails. The interesting thing is that it does log the exception to the Windows Event log which means that it IS loading the assembly!!? Following are excerpts from various files to show you what I mean...Web.Config: <configSections> <section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler, Microsoft.ApplicationBlocks.ExceptionManagement, version=1.0.1.0, culture=neutral, publicKeyToken=13da6d3f9482dd92"/> </configSections> <exceptionManagement mode="on"> <publisher mode="on" assembly="Brulant.Library.Exceptions, Version=1.0.1.1, Culture=neutral, PublicKeyToken=13da6d3f9482dd92" type="Brulant.Library.Exceptions.BrulantDatabasePublisher" exclude="" /> <publisher mode="on" assembly="Brulant.Library.Exceptions, Version=1.0.1.1, Culture=neutral, PublicKeyToken=13da6d3f9482dd92" type="Brulant.Library.Exceptions.BrulantTextFilePublisher"/> </exceptionManagement>FUSION LOG:*** Assembly Binder Log Entry (11/7/2003 @ 2:28:16 PM) ***The operation failed.Bind result: hr = 0x80070002. The system cannot find the file specified.Assembly manager loaded from: C:WindowsMicrosoft.NETFrameworkv1.1.4322fusion.dllRunning under executable C:WindowsMicrosoft.NETFrameworkv1.1.4322aspnet_wp.exe--- A detailed error log follows. === Pre-bind state information ===LOG: DisplayName = Microsoft.ApplicationBlocks.ExceptionManagement, Culture=neutral, PublicKeyToken=13da6d3f9482dd92 (Partial)LOG: Appbase = file:///c:/inetpub/wwwroot/CORELOG: Initial PrivatePath = binLOG: Dynamic Base = C:WindowsMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Filescoree5dbef76LOG: Cache Base = C:WindowsMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Filescoree5dbef76LOG: AppName = c6d4cac7Calling assembly : (Unknown).===LOG: Processing DEVPATH.LOG: DEVPATH is not set. Falling through to regular bind.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Post-policy reference: Microsoft.ApplicationBlocks.ExceptionManagement, Culture=neutral, PublicKeyToken=13da6d3f9482dd92LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/core/e5dbef76/c6d4cac7/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/core/e5dbef76/c6d4cac7/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CORE/bin/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CORE/bin/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.DLL.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/core/e5dbef76/c6d4cac7/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework/v1.1.4322/Temporary ASP.NET Files/core/e5dbef76/c6d4cac7/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CORE/bin/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.LOG: Attempting download of new URL file:///c:/inetpub/wwwroot/CORE/bin/Microsoft.ApplicationBlocks.ExceptionManagement/Microsoft.ApplicationBlocks.ExceptionManagement.EXE.LOG: All probing URLs attempted and failed.Any help is GREATLY appreciated.Thank you,PhilAnonymous
November 08, 2003
The problem is that the Version isn't fully specified (see the "Partial" in the Fusion log) :LOG: DisplayName = Microsoft.ApplicationBlocks.ExceptionManagement, Culture=neutral, PublicKeyToken=13da6d3f9482dd92(Partial)Fusion won't check the GAC for the assembly unless the full display name is given (see http://blogs.gotdotnet.com/suzcook/PermaLink.aspx/07954694-ac03-4459-80df-859a31cd76bc ).So, the code with the incomplete reference will need to be updated.It looks like the reference in the web.config is fully-specified, so that wasn't the causeof this failure. That's why the bind for the web.config type seemed successful (it was).Anonymous
November 11, 2003
Suzanne,Thanks for the informative blog. I am trying to deploy a windows app. Things were fine until I added an installer to the project to perform some custom actions. Using the fuslogvw I have located the problem. AppBase has been changed to Windows/System32 instead of the application folder. Therefore, when CLR probes for the assembly, it cannot find it and bind it. What would be the solution for this? I want the assemblies to stay where they are and not install it to GAC.Thank you very much for your help.KorhanAnonymous
November 12, 2003
Suzaane,Thanks for your reponse regarding my issue with the Microsoft.ApplicationBlocks.ExceptionManagement in the GAC. It turns out that the web.config WAS the issue. Previously I declared the assembly as:<section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement,version=1.0.1.0, culture=neutral, publicKeyToken=13da6d3f9482dd92"/>...well, I changed it to:<section name="exceptionManagement" type="Microsoft.ApplicationBlocks.ExceptionManagement.ExceptionManagerSectionHandler,Microsoft.ApplicationBlocks.ExceptionManagement, version=1.0.1.0, culture=neutral, publicKeyToken=13da6d3f9482dd92"/>...and it worked! Notice that I removed the CarriageReturn from the declaration between the end of the assembly name and the word "version." Any idea why this would cause an issue ONLY when the assembly is in the GAC?Thanks again,PhilAnonymous
November 12, 2003
Suzanne,I thought you might like to see the error log before answering my above question. Here it goes*** Assembly Binder Log Entry (11/12/2003 @ 3:45:13 PM) ***The operation failed.Bind result: hr = 0x80070002. The system cannot find the file specified.Assembly manager loaded from: C:WINDOWSMicrosoft.NETFrameworkv1.1.4322fusion.dllRunning under executable C:WINDOWSSystem32MsiExec.exe--- A detailed error log follows. === Pre-bind state information ===LOG: DisplayName = cWiz Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (Fully-specified)LOG: Appbase = C:WINDOWSSystem32LOG: Initial PrivatePath = NULLLOG: Dynamic Base = NULLLOG: Cache Base = NULLLOG: AppName = NULLCalling assembly : (Unknown).===LOG: Processing DEVPATH.LOG: DEVPATH is not set. Falling through to regular bind.LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).LOG: Post-policy reference: cWiz Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=nullLOG: Attempting download of new URL file:///C:/WINDOWS/System32/cWiz Client.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/System32/cWiz Client/cWiz Client.DLL.LOG: Attempting download of new URL file:///C:/WINDOWS/System32/cWiz Client.EXE.LOG: Attempting download of new URL file:///C:/WINDOWS/System32/cWiz Client/cWiz Client.EXE.LOG: All probing URLs attempted and failed.Anonymous
November 13, 2003
sir i have problem whenever calling asp.net pages in the event viewer "aspnet_wp.exe could bot be started . HREHULT for the further 80004005Anonymous
November 13, 2003
sir i have problem whenever calling asp.net pages in the event viewer "aspnet_wp.exe could bot be started . HREHULT for the further 80004005 please reply meAnonymous
December 04, 2003
Phil: Pre-v2.0, Fusion didn't ignore newlines in display names. The full display name needs to be (acceptably) specified for binds to the GAC to succeed. So, that's why it failed to load from the GAC. But, partial binds can work in the ApplicationBase, which you've noticed (though they're not recommended).Anonymous
December 05, 2003
Korhan and Sanjeev: Those types of questions are better suited for Microsoft's official technical support channels. They're about MsiExec.exe / ASP.NET specifically, not about the loader. Try http://support.microsoft.com/ .Anonymous
December 18, 2003
HiI need help please.........I have developed asp.net web application on 2002 ,Now i have only 2003 in my system and if i am trying to run the web application it is giving error:Microsoft (R) Visual Basic .NET Compiler version 7.10.3052.4for Microsoft (R) .NET Framework version 1.1.4322.573Copyright (C) Microsoft Corporation 1987-2002. All rights reserved.vbc : error BC32400: Class 'CLSID_CorSymWriter_SxS' could not be created: Class not registered vbc : error BC31019: Unable to write to output file 'C:WINDOWSMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Fileswebapplication34c7907884b8c4c7r6vd1nnj.pdb': Class not registered Thanks in adnaceAnonymous
December 30, 2003
Check your registry for that CLSID - sounds like it's not registered. I suspect that you may need to reinstall your v1.1 CLR.Anonymous
February 25, 2004
The comment has been removedAnonymous
March 02, 2004
Yes, for the failing case, the ApplicationBase is the exe's dir, Folder B. So, it is by design that it is trying to load it from there when loading by display name.
In the success case, I imagine that either the ApplicationBase is Folder A, or the LoadFrom context is being used. (See http://blogs.msdn.com/suzcook/archive/2003/05/29/57143.aspx for info about the LoadFrom context.)
Actually, for .NET, the InProcServer32 key may contain both an Assembly and a CodeBase value. However, please see the link above before relying on the CodeBase - usually the Load context is more appropriate.Anonymous
April 27, 2004
Using a reflection based plugin app.
Project A, B, and C are all in the same solution.
Project A is a web app. The web app loads up the assemblies in the bin directory looking for certain types. Project B is a plugin that project A directly references. Project C is a plugin that references project B, but is not referenced by Project A. When the solution is rebuilt (all references are now happy), everything works fine when Project C's assembly is dropped into the bin of the webapp.
When Project A and B are rebuilt, but not project C, the Project C's assembly in the bin folder of the webapp now references assemblies which are no longer there when Project C is loaded up in the reflection phase. What is the proper way to do this if Project C is updated more frequently than Project A or B?
The error we are getting is saying that methods in Project C "does not have an implementation".Anonymous
April 28, 2004
It sounds like the error comes from C having an outdated reference to B, because B is strongly-named, and has been rebuilt with a new version. Getting the Fusion log will verify it. See http://blogs.msdn.com/suzcook/archive/2003/05/29/57148.aspx for a discussion about avoiding that problem.Anonymous
May 02, 2004
The comment has been removedAnonymous
May 02, 2004
Ols, see http://blogs.msdn.com/suzcook/archive/2003/09/16/57247.aspx .Anonymous
May 06, 2004
The comment has been removedAnonymous
May 10, 2004
File or assembly name Microsoft.ApplicationBlocks.ExceptionManagement, or one of its dependencies, was not found.Anonymous
May 20, 2004
A different sort of assembly reference problem...
My application's assembly manifest is referencing an old version of a dependent .NET DLL. I can't figure out why.
The runtime finds the correct version, but thinks it's the wrong one.
The application's Reference is to the correct version. No DLLs of the old version exist on the file system or in the GAC. I've rebuilt the app, rebooted, restarted IIS, yelled at my monitor, and pulled out most of my hair.
So when an app is built, where does it get the reference version info that goes in the assembly manifest?
Thanks.Anonymous
May 24, 2004
Suzanne , Thanks I had a major problem,I googled and got many tips , Justw ante dto thank youAnonymous
June 07, 2004
The comment has been removedAnonymous
July 07, 2004
Compiler Error Message: BC31019: Unable to write to output file 'C:WINNTMicrosoft.NETFrameworkv1.1.4322Temporary ASP.NET Filesroot708093bd6afa7483acb1iqp0.dll': System Error &H80070005&
please i am sick of this,help me out man.Anonymous
August 03, 2004
Close your browser,find your file(acb1iqp0.dll),delete it and
reopen browser.
It maybe because of
-different file version between browser cache and server file.
-setting .NET framework security configuration.
Hope this help.Anonymous
April 22, 2005
I ran into a strange problem. My web app requires certain assemblies and of course when it starts, these assemblies are loaded in the application domain. And I can access them using AppDomain.GetAssemblies but this works only the first time after application load. Next time when web app is reloaded - because project has recompiled the GetAssembly does not show my assembly on the list of loaded assemblies. What’s a strange - fusion log show that the assembly successfully loaded but GetAssembly does not show it on the list.Anonymous
May 18, 2005
You may want to point out that a common cause of "Access is denied" issues when loading an assembly under ASP.NET is documented in http://support.microsoft.com/default.aspx?scid=kb;en-us;329065. The Windows Index service can lock the Temporary ASP.NET Files directory and the symptom is often an assembly load failure.
<BR>
See: PRB: Access Denied Error When You Make Code Modifications with Index Services Running
Article ID : 329065Anonymous
May 19, 2005
I am encountering the Bind result: hr = 0x80070005. Access is denied.
issue. But none of the solutions are working for me.
It works fine on 2000 and XP. But we are testing on 2003 and get the error.
We are Dynamically creating Assemblies and loading them in a seperate app space.
We are using LoadFrom to specify a directory outside the working directory of the current app.
Something intresting that I can't find any info on is this message we seen in the fusion logs on OS's where it works...
WRN: A duplicate assembly was found while copying the assembly item to the cache.
?Anonymous
May 19, 2005
Turns out it's just permissions... if i run the Application Pool as an ADmin it goes away.
now to find where the permissions are wrong.
Still intrested in that WRN message?Anonymous
May 24, 2005
I noticed the following behaviour of ASP.NET sites: when I start a Web side, Fusion reports bindings for assemblies in the BIN directory twice: first with partial name and then with full name. What happens then is that if later I try to load another assembly using LoadFrom, then if this assembly references those already loaded in ASP.NET cache, they fail to load if they have a different strong version. Basically this means that ASP.NET don't really treat private stong named assemblies as strong named: attempt to load extra plugins from other directories may fail if assembly with different version (but same) name is already in the cache.Anonymous
June 05, 2005
Dude, thanks a ton, I was really in a bind. Thankfully all it took was depends.exe to expose the issue.Anonymous
July 19, 2005
We are seeing this when using No Touch Deployment. Our windows .net clients gets dlls from our web server as needed.
Some of the dlls are loaded ok, some of the loads generate a FileNotFoundException. If I look in the IIS Log file, I see a 200 Return code for the dllfile in question so the web server returned the dll. Something on the client side is not 'finding' it or is blocking the return.
We log the details of the exception and I can see what the loader is trying to do:
LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:WINDOWSMicrosoft.NETFrameworkv1.1.4322configmachine.config.
LOG: Post-policy reference: Janus.Windows.ButtonBar.v2,
Version=2.0.1163.0, Culture=neutral, PublicKeyToken=21d5517571b185bf
LOG: Attempting download of new URL file:///C:/Program Files/Custom
Data Systems/AM.NET/Janus.Windows.ButtonBar.v2.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Custom
Data Systems/AM.NET/Janus.Windows.ButtonBar.v2/Janus.Windows.ButtonBar.v2.DLL.
LOG: Attempting download of new URL file:///C:/Program Files/Custom
Data Systems/AM.NET/Janus.Windows.ButtonBar.v2.EXE.
LOG: Attempting download of new URL file:///C:/Program Files/Custom
Data Systems/AM.NET/Janus.Windows.ButtonBar.v2/Janus.Windows.ButtonBar.v2.EXE.
LOG: Attempting download of new URL
http://172.16.5.1/AMNETAssemblies/Janus.Windows.ButtonBar.v2.DLL.
LOG: Attempting download of new URL
http://172.16.5.1/AMNETAssemblies/Janus.Windows.ButtonBar.v2/Janus.Windows.ButtonBar.v2.DLL.
LOG: Attempting download of new URL
http://172.16.5.1/AMNETAssemblies/Janus.Windows.ButtonBar.v2.EXE.
LOG: Attempting download of new URL
http://172.16.5.1/AMNETAssemblies/Janus.Windows.ButtonBar.v2/Janus.Windows.ButtonBar.v2.EXE.Anonymous
September 15, 2005
Hi,
I have a windows application using Interop and reflection installed on Win XP & Win2K machine(s). On some machine I get the above message which sometime allows my application to work after the display and sometime it crashes my application. It comes in different contexts and in different scenarios but not reproducable.
Can you help me? What I am doing worng n where?Anonymous
September 20, 2005
The comment has been removedAnonymous
September 20, 2005
Sorry for posting here. Thought this was a loader bug/limitation. It isn't. The bug belongs to the VC++ compiler team.
For anyone that googled their way onto this or are interested, the VC++ (BETA 2, anyway) compiler/linker will generate a bad image if any file in the project is not compiled with /clr (much help that is with asm routines). #pragma unmanaged can then be used to, etc, etc, etc...
Sorry again.Anonymous
October 18, 2005
In my case Fusion is not showing any log.In registry I created a new key LogPath in HKLM/Softwarre/Microsoft/Fusion and set its default value to H:tempfusion
but when I press refresh nothing happens and when i press View Log it says Error: Unable to open cache file!Anonymous
January 09, 2006
Thanks for the info! Not sure if in my case I have a special issue or if I'm just not fully understanding troubleshooting assemblies. I created a WinForm app simply named, compiled, installed, running in production. Recently decided to strong-name the entire VS solution, compiles fine, but does run due to "The located assembly's manifest definition...does not match the assembly reference." When I check the Fusion log it's indicating that a prior version of the .exe is being executed. All updated dependent assemblies show correctly - new ver., pub key, paths, names, etc. It seems something somewhere is trying to run the old .exe (in the new .exe path no less) despite the new application manifest being seemingly correct. What implications are there from going from a simply named to strong named code base?Anonymous
January 31, 2006
The comment has been removedAnonymous
February 10, 2006
Dear Madam,
thanks for the only explantion of this error, which I found in internet.
#his is because MC++ has made optimizations
Do you know is it possible to switch this optimizations off? Which compiler setting is it?
Thanks,
BoniAnonymous
February 19, 2006
Suzanne, Thanks a lot for the post; it solved a problem that I've been having for hours on end.
But in my case, it turned out there was a missing assembly, but the exception message said a type could not be loaded from an assembly that existed. Maybe loading this assembly triggered an attempted load of the non-existent one, but in that case, why doesn't the exception message say so? Why should I have to run fuslogvw?Anonymous
March 04, 2006
Great blog entry.
Using the log solved a problem I was stuck on
since yesterday.Anonymous
March 22, 2006
Hello Maam,
I have this strange problem while re-running any of C# assemlies more than once.
mid-way while running my application which references a assembly, i get this error :
Access is denied
After around 5 mins when i refresh the page it gets loaded.
i doubt some problem of history or garbage collection.
Can u please help me on this?Anonymous
March 28, 2006
Thanks for your blog. It helped me fix my managed file load problem.Anonymous
March 30, 2006
I am having a problem loading the following MS Enterprise Library assembly. I have tried many of the fixes on this blog (I think) below is the information from the fusion log:
Assembly manager loaded from: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727mscorwks.dll
Running under executable C:Documents and SettingskwenyonMy DocumentsVisual Studio 2005ProjectsRetailBeerSystemsRetailBeerSystemsbinDebugRetailBeerSystems.vshost.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = STRATISINCkwenyon
LOG: DisplayName = Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db1db703afa726aa
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/kwenyon/My Documents/Visual Studio 2005/Projects/RetailBeerSystems/RetailBeerSystems/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : Microsoft.Practices.EnterpriseLibrary.Configuration, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:Documents and SettingskwenyonMy DocumentsVisual Studio 2005ProjectsRetailBeerSystemsRetailBeerSystemsbinDebugRetailBeerSystems.vshost.exe.config
LOG: Using machine configuration file from C:WINDOWSMicrosoft.NETFrameworkv2.0.50727configmachine.config.
LOG: Post-policy reference: Microsoft.Practices.EnterpriseLibrary.Data, Version=1.1.0.0, Culture=neutral, PublicKeyToken=db1db703afa726aa
LOG: Attempting download of new URL file:///C:/Documents and Settings/kwenyon/My Documents/Visual Studio 2005/Projects/RetailBeerSystems/RetailBeerSystems/bin/Debug/Microsoft.Practices.EnterpriseLibrary.Data.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Can you please help me with this??Anonymous
April 05, 2006
I found the problem, it was a namespace or scope issue in my config file.Anonymous
April 06, 2006
Hello Suzanne - I have a factory that will get all files in the bin folder, load the assembly using Assembly.LoadFrom method and check if it supports a particular interface before creating an instance of the same. My problem is everything works fine when the ASPNET user is a member of the Administrators. Once i remove it from administrators then it fails with Access denied message. Any pointers, ideas is appreciated. ThanksAnonymous
April 18, 2006
The comment has been removedAnonymous
May 05, 2006
The comment has been removedAnonymous
May 05, 2006
The following links to .NET resources have been collated over time with the assistance of colleagues.&nbsp;...Anonymous
May 08, 2006
I ran across a blog post from Suzanne Cook this past&nbsp;weekend that has been around for a while, but...Anonymous
May 11, 2006
We have an issue using the hosting APIs from unmanaged C++ app. When calling pAppDomain->ExecuteAssembly_3 (...) the application runs if it is a C# application. If it is created with MC++, we get the COR_E_FIXUPSINEXE, which you cited above. So far so good.
Our problem now is we are hosting C# app which references a MC++ assembly. When the type from the MC++ assembly is used, we see COR_E_BADIMAGEFORMAT thrown. Is there any workaround for this problem?
We are using ICorRuntimeHost interface on the CLR v2.0.Anonymous
May 23, 2006
I am running into one of those Bind erros: result: hr = 0x80070002. The system cannot find the file specified.
I cannot figure it out... grrr...
It works when deployed on one server, but fails on another.
It is a windows forms dll being downloaded from a windows client app using Assembly.Load with a version number and a strong name. Prior to using the strong name I was using LoadFrom and got the same error.
The dll references a web service and some standard .net things like system...Anonymous
June 02, 2006
I am facing the same problem but I didn't find any useful help to resolve this problem. Could you please send me the pointers to resolve this issue.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=81140&SiteID=1
Thanks,
KannaAnonymous
June 14, 2006
The comment has been removedAnonymous
June 22, 2006
The comment has been removedAnonymous
July 07, 2006
The comment has been removedAnonymous
July 13, 2006
When I look at the fuslogvw window I see there are two entries for each assembly. From what I can tell the first entry is the result of a "partial bind" and all of the useful information is in there. The second entry shows the result of the subsequent "full bind" request and is useful for showing which assembly is requesting the bind.
My question is why is it loading on partial and then loading on fully-specified right afterwards? Should it matter to us in our asp.net application? Would we be better off changing to force the fully-specified be used only (i.e., through a vs reference rather than LoadFrom(..) )?
JeffAnonymous
July 13, 2006
This is basically a reminder post, but you might find it useful.
In the development I have been doing...Anonymous
August 15, 2006
Thanks to Suzanne Cook for this one. &quot;First, obviously, find the two types for which the cast failed,Anonymous
September 16, 2006
The comment has been removedAnonymous
November 08, 2006
The comment has been removedAnonymous
November 13, 2006
Hi, Could you help me on something a bit different? I have an unmanaged control (MFC) I want to use in IE. This is using several Dlls managed and unmanaged. The only way I set it to work is when I copied the managed assemblies to the IE dir. But they still need to be at the OCX dir for registration to work. Why? I also tried to load the managed assembly with LoadFrom, but it doesn't seam to change the IE context. I tried to sign the assemblies but now the ocx is not registering, when I specify the publicKey in the dependency. Thanks a lot... SandraAnonymous
December 23, 2006
Could this same information be included in exception messages when loads fail? It is rare for a fusion log to be enabled on a machine, and having to enable it and then try to recreate an error is 1) tedious internally, 2) untenable externally (ever try to get an end-user to enable a fusion log). This information is exactly what a developer expects to see in an exception message.Anonymous
December 23, 2006
We spent two days tracking down the cause of HRESULT: 0x8013141A. The fusion log didn't help. The problem was ultimately tracked to calling LoadFrom with an assembly's full pathname that was not in the build path or GAC, where the assembly being loaded and the assembly doing the loading were both delay signed, and skip verification had not been run. Googling for the answer to the problem was futile, because there were too many false positives. It would be very helpful to have a table available online that lists each of the loader error codes, and every known possible cause of each error. This blog might be a good place to start such a table.Anonymous
December 26, 2006
We have delay-signed assemblies on a test machine. Skip verification has been run. We can load an assembly from the build output directory using Assembly.LoadFrom, but the fusion log consistently displays a load failure for XmlSerializers, an assembly that exists nowhere on our machine. We think it is something that .NET generates. We have disabled all "Generate serialization assembly" dropdowns in all of our projects, and that seems to have no effect. There are numerous posts online about this bind failure and XmlSerializers, but no answers to the problem. Can you explain what is happening, whether that can cause loads to fail (it does in our case if we disable skip verification), and how to make it stop? Here is the fusion log: *** Assembly Binder Log Entry (12/26/2006 @ 8:57:50 AM) *** The operation failed. Bind result: hr = 0x80070002. The system cannot find the file specified. Assembly manager loaded from: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727mscorwks.dll Running under executable C:Program FilesTestDriven.NET 2.0ProcessInvocation.exe --- A detailed error log follows. === Pre-bind state information === LOG: User = XYZtestuser LOG: DisplayName = TestProject.XmlSerializers, Version=2.1.3.0, Culture=neutral, PublicKeyToken=7ce6deabcb36a8ea, processorArchitecture=MSIL (Fully-specified) LOG: Appbase = file:///C:/BuildOutput/assemblies/Debug LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = C:Documents and SettingstestuserLocal SettingsTempTestDrivenShadowCopy633027202692884393 LOG: AppName = domain-nunit.addin.dll Calling assembly : System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089. === LOG: This bind starts in default load context. LOG: Using application configuration file: BuildOutputassembliesDebugTestProject.dll.config.temp LOG: Using machine configuration file from C:WINDOWSMicrosoft.NETFrameworkv2.0.50727configmachine.config. LOG: Post-policy reference: TestProject.XmlSerializers, Version=2.1.3.0, Culture=neutral, PublicKeyToken=7ce6deabcb36a8ea, processorArchitecture=MSIL LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/BuildOutput/assemblies/Debug/TestProject.XmlSerializers.DLL. LOG: Attempting download of new URL file:///C:/BuildOutput/assemblies/Debug/TestProject.XmlSerializers/TestProject.XmlSerializers.DLL. LOG: Attempting download of new URL file:///C:/BuildOutput/assemblies/Debug/TestProject.XmlSerializers.EXE. LOG: Attempting download of new URL file:///C:/BuildOutput/assemblies/Debug/TestProject.XmlSerializers/TestProject.XmlSerializers.EXE. LOG: All probing URLs attempted and failed.Anonymous
January 17, 2007
I have an issue that is related to the IE7 installation on XP. The system MPR and SHLWAPI DLLs have been updated during IE7 install and now attempt to load DWMAPI.DLL (a Vista only DLL). My problem is when I create an application that runs as a Windows Service using .NET and VS2005 C#. I have a utility .NET Class project (DLL) that specifically uses the System.Net assemblies and is called by my Windows Service assembly. I also have another non-Windows Service application that also uses the utility class. The non-service application uses the same code in the Window Service version and it runs fine. It loads the utility class DLL without crashing even though I've used the Depends tool to verify that there is a problem finding the missing DWMAPI.DLL. The Windows service version of my application however crashes with a "Could not load file or assembly" error when accessing my utility DLL. Apparently whatever missing code is in DWMAPI.DLL is not really accessed by my utility DLL since all functionality is there in my non-service application. It is just the Service application that bails out on the loading of the DLL. What is the difference between dynamic assembly loading for a .NET Windows Service application and a standard .NET Windows Application? Is there a way for me to set a config switch or add some code to my utility DLL so that dynamic assembly loading doesn't crash the service app during load time? My other only recourse is to move the code from my utility DLL and place it directly into each of the applications. Thanks, GQAnonymous
January 29, 2007
This is basically a reminder post, but you might find it useful. In the development I have been doingAnonymous
February 13, 2007
hi i am running my asp.net ajax application in windows 2003 server with iis6 but everything is working fine in all the browsers but i am getting following error in Internet Explorer 7…. MissingMethodException: Method not found any help?. thanks in advance. YoganandAnonymous
February 24, 2007
Hi Suzanne, Again and again and again I've been plagued by assembly binding failures "The located assembly's manifest definition with name [yourAssembly] does not match the assembly reference" or MissingMethodExceptions. After using fuslogvw and whatever, I still could not find any error on my side. I am having strongly-named assemblies and I am exclusively using project references in my solution; and there is no reason why references should break from time to time. (VS 2005 SP1 was no remedy, by the way.) --> There is something very intersting I found out today, which I haven't found in any blog so far, and which I wanted to share with you and all others who are facing the same problem. I found that the defective solution without any modifications would compile and run perfectly, when I rename the base folder which contains it, or when I copy it into another folder, or when I run it on a different machine. The funny thing is, when I rename the folder back to the old names, the reference breaks again. Even though fuslogvw states to have loaded all current assembly versions, and even though all assembly versions in my bin folder are up-to-date, an older copy is loaded from somewhere, and I assume this happens after a file had been locked (an assumption based on when it happens). --> If anybody has an idea, especially if there might be another way like clearing a cache or whatever instead of renaming the solution folder (which isn't best practice of solving this issue I believe), please let me know. oliver.hausler AT hausler.infoAnonymous
February 26, 2007
Suzanne stated in another thread, that strongly-named assemblies aren't updated in the download cache when the assembly version hasn't changed. This leaded me to the conclusion, that calling "gacutil /cdl" to delete the download cache manually before each compilation would solve the problem, and bingo, the problem is gone.Anonymous
February 26, 2007
Hi, I am looking for solving a problem with hosting a WinForm UserControl in an aspx page in ie6 / 7. The problem is not located in resolving the dll, because fuslogvw says the dll was successfully loaded, but in not displaying the form in the page on the client. All I can see is a little square as placeholder for the control. I can't find any information about further debugging beyond this point. All hints on enabling DebugIEHost seem to only work in .NET 1.1 and older, but not in 2.0 and newer?!? All security issues I checked over and over again. The control is loading on one machine on the other it does not. On some machines one of the two controls I host in this application does load, the other on does not. I am only lokking for new input resolving this problem, becaus I really don't know what to do further more. Every hint or link would be a great help for me. Thank you all Andreas andreas dot draheim at impuls-nbg dot deAnonymous
March 10, 2007
The conventional method of creating publisher policy (PP) assemblies becomes cumbersome when dealingAnonymous
April 04, 2007
hi i want to create a my application to check assembly binding failures. The objective is to use this application on a computer without sdk installed. You think this is possible? can you help me? thanksAnonymous
April 12, 2007
First, obviously, find the two types for which the cast failed and verify that they are the same typeAnonymous
April 12, 2007
Say you've just installed some assemblies from a third party and now you're seeing a MissingMethodException,Anonymous
April 12, 2007
Say you're debugging your application and you see that version 1.0 of an assembly is being loaded whenAnonymous
June 14, 2007
Hi Suzanne this blog is an excellent source of knowledge. many postings here seem to be in a direction of it runs on one but not on the orther machine or it does not run on this machine. Maybe some links on basic things to check(from an enginering not dev perspective) would help Maybe such a tool does exist in some dev root of microsoft.... This would solve many of my deployment problems and would be greatly appriciated !!!Anonymous
June 19, 2007
OK, fusion is the solution but it doesn't reveal to me why these things are so deeply covered under the surface. Not sure if there is any ressource e.g. book, internet, course which has all on dotnet aspects sorry if my english is here a bit rudeAnonymous
August 08, 2007
Here is the situation. A .net executable scans a predefined directory for dll files. It will load each dll, enumerate the types and try to do a CreateInstance on each type implementing some known interface. This mechanism usually works fine, but sometimes a FileNotFound exception occurs. A debugging session showed the assembly is loaded correctly, then the CreateInstance causes the creation of an object located in this already loaded assembly. The runtime then tries to load the dll again. As the dlls are located in a predefined directory it cannot find them and raises this exception. After wondering why the runtime would try to load a dll it already has in memory, I decided to just manually copy them in the Debug directory of my project. Another Debug session, and this exception is gone, but a new one occurs System.IO.FileLoadException. The runtime seems to complain about this: "The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)" Using your tutorial I have gone through the fusion logging troubleshooting, and found this: "Comparing the assembly name resulted in the mismatch: Revision Number". Which seems odd to me as the dlls are projects I have compiled myself, and I have checked every copy of them located on my hard drive, and all the files are identical. (All those files have strong names too) Thanks in advance for your help.Anonymous
January 02, 2008
hi, I have a little pickle while loading my app. Would appreciate it so much if you could help! =) Checked the paths, and the logs created by fuslogvw I did use a batch ngen job to make native images of all my assemblies earlier.But i've uninstalled them, i checked them with ngen display <asm> interestingly, caspol complains "unable to load assembly" Heres the log for the main executable: http://pastebin.com/f3dd89ada the above assembly in turn should load 4 other assemblies, heres the log to one of them(since all of them are alike): http://pastebin.com/f715d7c5e Thanks so much GideonAnonymous
January 28, 2008
The comment has been removedAnonymous
February 04, 2008
I am trying to implement a "normal" publisher policy. I have an assembly, that I created using ILMerge from another assembly (.net) and some other interop..dll files. The problem is that the fusion log tells me: WRN: Comparing the assembly name resulted in mismatch of Processor Architecture: Ref MSIL, Def Legacy. So basically the bindingRedirect is working, but the processorArchitecture between the policy assembly and the actual assembly is different. Now when I create the publisher policy I can control which platform to make an assembly (policy..dll) for, but I don't know how I can get it to create a 'Legacy' architecture (IF there is such a thing at all). On the other hand, if I cannot change this policy assembly, I have not found a way how I can specify that the created dll (using ILMerge) has MSIL as platform (or any other one for that reason) Any ideas would help me a lot. Thanks a dozen for anyone who can answer this. MaxAnonymous
February 24, 2008
Thanks! Helped me get to the bottom of a problem w/0x80131040 I was struggling with.Anonymous
March 13, 2008
Can We work with single Clr on Diffrent versions.Anonymous
July 23, 2008
The comment has been removedAnonymous
September 01, 2008
Many thanks! This solved a problem I'd been having and the rest of the internet was being unhelpful about.Anonymous
November 12, 2008
Hey Suzanne, Could you please help me out for I am getting System.IO.FileLoadException: Could not load file or assembly 'Interop.SHDocVw, Version=1.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040). I am using this dll in my test project The problem is that if I reference this dll in a separate project it works fine and gets loaded However if I reference in my existing test project then It throws the mentioned error I made sure to remove all the previous versions of Interop.shdocvw dlls and replaced it with that of System32 folder. Helping to resolve this will be highly appreciatedAnonymous
January 13, 2009
Hi , i have some questions about you desing maybe you can give designer contacts?Anonymous
February 09, 2009
The comment has been removedAnonymous
February 24, 2009
I have an error in IE7: MissingMethodException: Method not foundAnonymous
March 23, 2009
Hi, following steps resvoled my problem: Cleant IE cash and file. unregister asp .net aspnet_regiis -u register asp .net aspnet_regiis -i assign aspnet user to c:windowstemp Hope this help.sAnonymous
July 07, 2009
I am experiencing assembly binding failures due to insufficient permissions to the Temporary ASP.NET Files folder. The application uses (web.config) Forms authentication with Impersonate = True and IIS Windows Integrated Authentication. According to ASP.NET Identity Matrix, this means that the WindowsIdentity resolves to DomainUserName and according to ASP.NET Required Access Control Lists (ACLs), the WindowsIdentity requires read/write permissions to the Temporary ASP.NET Files folder. Using the Fusion log viewer, I can confirm that the assembly binding failure is due to DomainUserName (belonging to the "Users" group in security) only having read permissions to this folder, but not write permissions. The questions are: Are there any security implications of assigning write permissions to the Temporary ASP.Net Files folder? Is such a server configuration change commonly used? If not, why would WindowsIdentity resolve to DomainUserName for this combination of web.config settings - or should this combination not be used in this context? Note: The problem only occurs if a non-admin user is the first to hit the page. If the assembly has already been compiled and stored in Temporary ASP.NET Files due to an admin user hitting the page, there are no problems for subsequent users. I do NOT wish to place the assemblies in the GAC.Anonymous
July 23, 2009
The comment has been removedAnonymous
September 15, 2009
I am getting this error in the fusion log viewer, when i run my application. could you please help me see figure this out? *** Assembly Binder Log Entry (16-Sep-2009 @ 1:52:33 PM) *** The operation failed. Bind result: hr = 0x80131040. No description available. Assembly manager loaded from: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727mscorwks.dll Running under executable C:Program FilesMicrosoft OfficeOffice12WINWORD.EXE --- A detailed error log follows. === Pre-bind state information === LOG: User = DECOSSOFTDEVnikunj LOG: DisplayName = DecosOdmaAssembly, Version=30.0.0.25144, Culture=neutral, PublicKeyToken=9f8142849d324fd0 (Fully-specified) LOG: Appbase = file:///C:/Program Files/Microsoft Office/Office12/ LOG: Initial PrivatePath = NULL LOG: Dynamic Base = NULL LOG: Cache Base = NULL LOG: AppName = NULL Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: C:Program FilesMicrosoft OfficeOffice12WINWORD.EXE.Config LOG: Using machine configuration file from C:WINDOWSMicrosoft.NETFrameworkv2.0.50727configmachine.config. LOG: Post-policy reference: DecosOdmaAssembly, Version=30.0.0.25144, Culture=neutral, PublicKeyToken=9f8142849d324fd0 LOG: GAC Lookup was unsuccessful. LOG: Attempting download of new URL file:///C:/Program Files/Microsoft Office/Office12/DecosOdmaAssembly.DLL. LOG: Assembly download was successful. Attempting setup of file: C:Program FilesMicrosoft OfficeOffice12DecosOdmaAssembly.dll LOG: Entering run-from-source setup phase. LOG: Assembly Name is: DecosOdmaAssembly, Version=30.50.108.24769, Culture=neutral, PublicKeyToken=9f8142849d324fd0 WRN: Comparing the assembly name resulted in the mismatch: Minor Version ERR: The assembly reference did not match the assembly definition found. ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated. Thanks & Regards, Nikunj BankerAnonymous
June 01, 2010
Do you know how to get the fusion log running .net on a mobile device? I do have some typeLoadException and i am curious if fusion log may help on .net compact framework 3.5!? Thanks & Cheers RollekAnonymous
December 06, 2010
I have a big problem Error: BC31019: Unable to write to output file "___.pdb": Unkown error. I cannot run/debug/release the application the error appeared suddenly during the Build of one project. Deleting the obj-Folder didnt help, I found no useful solutions in the web. Please help me!