System.IO.FileLoadException was unhandled


  • Hi,
    I have this error "System.IO.FileLoadException was unhandled" here and there always.

    I build an application using a dll. But, when I run that app, I get the "System.IO.FileLoadException was unhandled"
      Message="Could not load file or assembly 'Assembly name, Version=, Culture=neutral, PublicKeyToken=f07652a56255dcb5' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

    Why is this so ?
    If I have the built the app using a specific version of dll, the manifest should refer that version. Why I get this error ?

    I got this error sometime earlier. But I don't remember how I got past that error.

    Monday, December 03, 2007 4:45 PM

All replies

  • In the project's properties window (Application tab), under Resources, if Icon and manifest is selected change Manifest from "Embed manifest with default settings" to "Create application without a manifest".


    Monday, December 03, 2007 6:47 PM
  • Hi,

    I don't see this setting in VS 2005.

    BTW, what does it mean ?

    And why do I get the error ?

    Tuesday, December 04, 2007 4:53 PM
  • I'm afraid I have to admit to ignorance here. I ran into the same exception once, found a quick fix on the net (sorry, can't remember where), and it worked. I never got around to learning about the manifest's purpose.


    This was a VS 2008 solution. I don't know about 2005. Perhaps your problem is something different. Hopefully someone here more knowledgable then I will speak up.


    Thursday, December 06, 2007 1:36 AM
  • Have you re-built the DLL since you added it as a reference?  Or...


    Have you tried adding the DLL as a project to your current solution?  A multi-project solution.  (So that way it builds at the same time.)  Watch out for project depnedincies, too. ( On a multi-project solution, right-click on solution name and check out the Configuration Manager. )


    Also, are you building the DLL as a "Debug" or as a "Release" version?





    • Proposed as answer by akjha Tuesday, July 15, 2008 7:39 PM
    Thursday, December 06, 2007 1:44 AM