Pergunta

The Error

The error is as follows (only slightly obfuscated):

Could not load file or assembly 'Assembly.Name' or one of its dependencies. The system cannot find the file specified.

The environment that is generating this error is an asp.net webforms application that I inherited, and the "assembly" in question is currently being auto-generated from raw code in the App_Code directory.

What I've Tried

  1. I've verified that the assembly is present and find-able. The majority of the pages in the webforms app use this particular assembly, and they work fine, but one particular page throws the error.

  2. I've verified that the assembly in question is properly declared in the using statements, just like it is in the other (working) pages.

  3. I've checked the error stack trace, which is pretty unhelpful, composed entirely of System.Web library calls.

    For what it's worth, the stack trace begins with:

    Stack trace: at System.Web.UI.TemplateParser.ProcessException(Exception ex)
    
  4. I've turned on page tracing, but the error happens too early in the execution for the page to render traces.

  5. I've checked the error message for mention of a code file and line number, neither are present.

The Question

Are there any tricks to find out what "specified file" the system is unable to find? The assembly is rather large, and I'm quite surprised that the system is unwilling to tell me specifically which "specified" file it can not find!

Foi útil?

Solução

  1. You can try to enable Fusion log by editing registry as explained here: How to enable assembly bind failure logging (Fusion) in .NET

  2. You can try running Process Monitor from SysInternals suite (Download here http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) and watching for which dlls the process tries to load right after accessing the 'Assembly.Name'

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top