none
"Unable to resolve assembly 'SomeDLLName', verision=...; however 'SomeDLLName' is not referenced! RRS feed

  • Question

  • Hi all;

    A web application, hosted in IIS, is undergoing a major rewrite, using entity framework for the back end, and a lot of angular front end.

    When trying to run the code on a test machine, i get an error, which the event log records as:

    ...

    Exception information: 
        Exception type: FileNotFoundException 
        Exception message: Unable to resolve assembly 'stateevallib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

    ...

    the call stack shows that the exception occurs when the code is doing:

    ...EvalEntities.Database.ExecuteSqlCommand(sqlCmd);

    the stack trace continues through a bunch of stuff in System.Data.Entity.Core, and ends here:

    ...at System.Data.Entity.Core.Metadata.Edm.MetadataArtifactLoaderCompositeResource.CreateResourceLoader(String path, ExtensionCheck extensionCheck, String validExtension, ICollection`1 uriRegistry, MetadataArtifactAssemblyResolver resolver)

    I guess it's the MetadataArtifactAssemblyResolver trying to find 'stateevallib'?

    Now, the really weird thing is... 'stateevallib' is *not* referenced *anywhere* in the current code base.  A string search through all the sources reveals that the string is used once in a file as a comment.  Nothing executable.  In fact, it used to be an assembly used in the old code base, but it is nowhere to be found currently.

    The project only fails when deployed to the test machine, which, incidentally has instances of the old web application.  The application runs fine locally.

    Can anyone help me figure out why the code is trying to load this (*unreferenced*) dll?

    thanks in advance for any insight.

    david



    dmc_lat47

    Friday, April 15, 2016 9:52 PM

Answers

  • Hi dmc_lat47,

    According to your description, it works fine on your local machine, but it doesn't work on test machine, from the error message, it seems that your test machine doesn't have a stateevallib, which cause the issue, as your said, in the current code, you don't add any reference with stateevallib. please check if related code (such as inheriting, derivative) has a reference with stateevallib.

    in addition, I would suggest that you could delete the file which has the error, and recreate an file about it and check if it works on your test machine.

    Best regards,

    Cole Wu

    Monday, April 18, 2016 3:03 AM
    Moderator
  • Finally figured this out, after hours of hair pulling.

    Turns out, a reference to the dll was being added to the web.config by the auto-deployment tools when deploying to test.

    The reference wasn't picked up in a global search because i was searching through the src folder, and the deployment scripts weren't in that sub tree...

    this was such a bonehead mistake! :(



    dmc_lat47

    • Marked as answer by dmc_lat47 Monday, April 25, 2016 1:16 PM
    Monday, April 25, 2016 1:16 PM

All replies

  • Hi dmc_lat47,

    According to your description, it works fine on your local machine, but it doesn't work on test machine, from the error message, it seems that your test machine doesn't have a stateevallib, which cause the issue, as your said, in the current code, you don't add any reference with stateevallib. please check if related code (such as inheriting, derivative) has a reference with stateevallib.

    in addition, I would suggest that you could delete the file which has the error, and recreate an file about it and check if it works on your test machine.

    Best regards,

    Cole Wu

    Monday, April 18, 2016 3:03 AM
    Moderator
  • Is "stateevallib" a dll file.

    Copy "stateevallib" manually into the bin folder in your test machine and see whether that works.

    chanmm


    chanmm

    Tuesday, April 19, 2016 8:33 AM
  • Finally figured this out, after hours of hair pulling.

    Turns out, a reference to the dll was being added to the web.config by the auto-deployment tools when deploying to test.

    The reference wasn't picked up in a global search because i was searching through the src folder, and the deployment scripts weren't in that sub tree...

    this was such a bonehead mistake! :(



    dmc_lat47

    • Marked as answer by dmc_lat47 Monday, April 25, 2016 1:16 PM
    Monday, April 25, 2016 1:16 PM