Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
605 views
in Technique[技术] by (71.8m points)

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...