且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

错误试图运行项目:该模块应包含一个程序集清单

更新时间:2023-11-09 23:35:22


  

该模块应包含一个程序集清单


块引用>

这是一个低级别的组件加载的问题。在CLR已找到与正确名称的文件,但是当它试图加载程序集,它发现该文件不包含正确的清单。 .NET程序集必须包含一个清单,它包含了描述程序集元数据,在装配列出的类型等。

如果你不知道什么EXE或DLL可能是麻烦制造者,那么你可以使用的 Fuslogvw.exe实用


  1. 从Visual Studio命令提示符开始吧。

  2. 单击设置按钮,然后单击登录失败绑定到磁盘单选按钮。

  3. 切换回VS和启动程序,并等待出现异常。

  4. 返回Fuslogvw,点击刷新按钮,然后双击添加的条目。

  5. 这表明你它找到该文件。

几种可能性,一个常见的​​这些天是试图加载.NET 4组件有EXE的要求CLR版本2.要求强制使用CLR 4的app.exe.config文件。

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?

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.