none
The located assembly's manifest definition does not match the assembly reference RRS feed

  • Question

  • Hi

    I am getting following error while compiling project.


    Error :->  'The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

    Error EnvironMent & Condition :-> Earlier I was having windows 2000 on which my project was working fine using framework 2.0 VS 2005. Now I am having Windows XP and framework 2.0  & VS 2005 but when I am trying to compile the project its giving me following error. I tried several tricks none helped me. I have replaced LC.exe also  reinstalled framework 2.0.

    Error description :->
    The assembly with display name 'AssemblyName' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.IO.FileLoadException : Could not load file or assembly 'AssemblyName, Version=xxxxxx, Culture=neutral, PublicKeyToken=xxxxxxxxx' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    File name: 'AssemblyName, Version=xxxxx, Culture=neutral, PublicKeyToken=xxxxxxxx'

    === Pre-bind state information ===
    LOG: User = DomainName\UserName
    LOG: DisplayName = AssembltName, Version=xxxxxx, Culture=neutral, PublicKeyToken=xxxxx
     (Fully-specified)
    LOG: Appbase = file:///x:/xxxxxx/xxxxxx
    LOG: Initial PrivatePath = NULL
    Calling assembly : AssemblyName, Version=xxxx Culture=neutral, PublicKeyToken=null.
    ===
    LOG: This bind starts in default load context.
    LOG: Using application configuration file: x:\xxx\xxxxx\xx.vshost.exe.config
    LOG: Using machine configuration file from C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
    LOG: Post-policy reference: AssemblyName, Version=xxxxx, Culture=neutral, PublicKeyToken=xxxxxxx
    LOG: Attempting download of new URL file:///X:\xxxxx\x\xx\xxx
    WRN: Comparing the assembly name resulted in the mismatch: Revision Number
    ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.


    Waiting for reply..
    Thanks
    Sopan Deshmukh
    sopan.deshmukh@gmail.com
    Monday, April 13, 2009 1:30 PM

Answers

  • In your project the assembly reference is probably configured as an "exact match" and the runtime fails while trying to locate an assembly with that *exact* name (based on the warn the revision number is off). To change the reference configuration in your project "References" folder select the reference, go to "Properties" and change "Specific Version" to false.

    Paul

    • Marked as answer by nobugzModerator Tuesday, April 14, 2009 1:11 AM
    • Unmarked as answer by sopan deshmukh Tuesday, April 14, 2009 4:51 AM
    • Marked as answer by Zhi-Xin Ye Friday, April 17, 2009 11:19 AM
    Monday, April 13, 2009 2:09 PM

All replies

  • In your project the assembly reference is probably configured as an "exact match" and the runtime fails while trying to locate an assembly with that *exact* name (based on the warn the revision number is off). To change the reference configuration in your project "References" folder select the reference, go to "Properties" and change "Specific Version" to false.

    Paul

    • Marked as answer by nobugzModerator Tuesday, April 14, 2009 1:11 AM
    • Unmarked as answer by sopan deshmukh Tuesday, April 14, 2009 4:51 AM
    • Marked as answer by Zhi-Xin Ye Friday, April 17, 2009 11:19 AM
    Monday, April 13, 2009 2:09 PM
  • Hello Paul

    Thanks for your suggestion.
    I have tried your suggestion and made all references "Specific Version" properties to false.
    Still it's giving me same error as specified in above post.
    I have filename.licx in my project, when I exclude it from project gives above error and when I includes it in project it gives following error

    Error :Error    5    D:\XXXXXXX\XXXXX\XXX\XXXXX\LC     'The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)'    XXXXX

    I guess its a problem related with LC.exe but not 100% sure, need your help to fix it.

    Sopan Deshmukh
    Tuesday, April 14, 2009 5:03 AM
  • Is the assembly you are referencing strongly signed and if yes is it in the application path or in the GAC ? If it's in the GAC what version does it have, does it match the version you're binding to ?
    • Proposed as answer by p.b.a Wednesday, April 15, 2009 6:48 PM
    Tuesday, April 14, 2009 1:37 PM
  • Hello Paul

    Thanks for your help.
    You was right the problem was with dll versions. Public tokens used in licx file was wrong so it was giving me the error. After putting proper public key tokens, program get correctly compiled and in runs properly now.

    Thanks
    Sopan Deshmukh
    sopan.deshmukh@gmail.com



    • Proposed as answer by ROHIT NAKTODE Thursday, September 29, 2011 5:29 AM
    • Unproposed as answer by ROHIT NAKTODE Thursday, September 29, 2011 5:29 AM
    Wednesday, April 15, 2009 7:03 AM
  • hey sopan 

    how did you do that changing the public token 

    actually m also getting the same error......................... so how do i resolve this please reply soon.

    Thursday, September 29, 2011 5:31 AM
  • hey paul

    where do i find "reference folder"

    i am not getting ite location 

    place tell me the location of references folder.


    Thursday, September 29, 2011 5:53 AM
  • Hi Rohit,

           You may want to check the settings of the Visual Studio (assuming you are using version 2010) related to Exceptions box.

    You can obtain it pressing Ctrl + Alt + E. You should reset all and try again.

    Kind regards,

    Radu.

    Thursday, June 14, 2012 11:01 AM
  • I am also getting the same error. In my case I want to load resourcedictionary from setallite assembly which I am not referencing. How could I resolve this error in my case.

    Thanks.


    • Edited by Dami Friday, October 19, 2012 4:35 PM
    Friday, October 19, 2012 3:45 PM