Error while trying to run project:The module was expected to contain an assembly manifest

12

When I try to run the project it says:

Error while trying to run project:could not load file or assembly 'Project.exe' or one of its dependencies.
The module was expected to contain an assembly manifest.

When I ran the exe from the debug folder I got this error:

application unable to start correctly (0xc000007b)

I also reinstalled Visual Studio but it doesn't seem to work!

How can I solve my problem?

c#
visual-studio-2010
asked on Stack Overflow Aug 27, 2012 by KF2 • edited Mar 31, 2016 by KF2

6 Answers

27

The module was expected to contain an assembly manifest

It is a low-level assembly loading problem. The CLR has located a file with the right name but when it tries to load the assembly, it finds out that the file doesn't contain a proper manifest. A .NET assembly must contain a manifest, it contains metadata that describes the assembly, listing the types in the assembly, etc.

If you have no clue what EXE or DLL might be the troublemaker then you can use the Fuslogvw.exe utility:

  1. Start it from the "Visual Studio Command Prompt".
  2. Click the "Settings" button and click the "Log binding failures to disk" radio button.
  3. Switch back to VS and start the program and wait for the exception to occur.
  4. Back to Fuslogvw, click the "Refresh" button and double-click the added entry.
  5. It shows you the file it found.

Several possibilities, a common one these days is to trying to load a .NET 4 assembly with an EXE that asked for CLR version 2. That requires an app.exe.config file that forces CLR 4 to be used.

answered on Stack Overflow Nov 22, 2012 by Hans Passant • edited Jan 7, 2016 by Benoit Blanchon
5

In my case I just change Target Framework(.Net Framework 4) in Project Properties. It solves the problem.

answered on Stack Overflow Nov 29, 2012 by (unknown user)
2

I have the same problem when I use Vs2012 utimate to publish Asp.net Mvc4, then upload dll to server. I fixed it by build code as Release mode then upload all dll in bin folder to server.

answered on Stack Overflow Dec 18, 2013 by Thanh
0

0xc000007b is "STATUS_INVALID_IMAGE_FORMAT". From experience, this points me to the project properties. A few things worth checking out:

  • Check to see if all the build options are set to either x86 or x64, depending on your system architecture, or AnyCPU.
  • If you're using dlls, consider whether they were compiled for your target architecture or not. If not, then recompile them accordingly or get them in the right version from wherever you got them.
  • Finally, check if your project assembly and loaded assemblies have different names. That seems to make things go boom as well.
answered on Stack Overflow Nov 28, 2012 by Wim Ombelets • edited Jun 12, 2017 by ViRuSTriNiTy
0

IN my case it get fixed by just going to project properties and set-->startup object projectname.program and build->platform target--> x86.

answered on Stack Overflow Jun 17, 2013 by Mona
0

i just resolve this by problem by restarting System as well in project properties i set to multi users as well in combo box start option.hope this will help u.

answered on Stack Overflow Dec 5, 2013 by Nizam

User contributions licensed under CC BY-SA 3.0