尝试运行项目时出错:该模块应包含程序集清单 [英] Error while trying to run project:The module was expected to contain an assembly manifest

查看:42
本文介绍了尝试运行项目时出错:该模块应包含程序集清单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行该项目时,它说:

<块引用>

尝试运行项目时出错:无法加载文件或程序集Project.exe"或其依赖项之一.
该模块应包含程序集清单.

当我从调试文件夹运行 exe 时,我收到此错误:

<块引用>

应用程序无法正确启动 (0xc000007b)

我也重新安装了 Visual Studio,但它似乎不起作用!

我该如何解决我的问题?

解决方案

该模块应包含程序集清单

这是一个低级程序集加载问题.CLR 找到了一个名称正确的文件,但是当它尝试加载程序集时,它发现该文件不包含正确的清单..NET 程序集必须包含一个清单,它包含描述程序集的元数据、列出程序集中的类型等.

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

  1. 从Visual Studio 命令提示符"启动它.
  2. 单击设置"按钮,然后单击将日志绑定失败记录到磁盘"单选按钮.
  3. 切换回VS,启动程序,等待异常发生.
  4. 返回 Fuslogvw,单击刷新"按钮并双击添加的条目.
  5. 它会显示找到的文件.

几种可能性,如今常见的一种是尝试使用要求 CLR 版本 2 的 EXE 加载 .NET 4 程序集.这需要一个 app.exe.config 文件来强制使用 CLR 4.

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.

这篇关于尝试运行项目时出错:该模块应包含程序集清单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆