C# HRESULT 异常:0x80131047
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12520212/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Exception from HRESULT: 0x80131047
提问by Omarrrio
I am having this problem whenever I try to debug my project:
每当我尝试调试我的项目时,我都会遇到这个问题:


It's in French, here is my translation:
这是法语,这是我的翻译:
"Error while trying to run project: Failed Loading assembly "DBZ buu's Fury Text Editor" or one of it's dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)"
“尝试运行项目时出错:加载程序集“DBZ buu 的 Fury 文本编辑器”或其依赖项之一失败。给定的程序集名称或代码库无效。(来自 HRESULT 的异常:0x80131047)
Can anyone help me please?
有人可以帮我吗?
采纳答案by Omarrrio
Project > Project Properties > Name > remove the "'" from the name, and it will work :)
项目>项目属性>名称>从名称中删除“ '”,它会起作用:)
回答by Leo Gurdian
It may not necessarily be related to that as in my case...
它可能不一定与我的情况有关......
First, I would like to say that this was a very hard issue troubleshoot as there may be many variables leading to the actual problem related to assemblies.
首先,我想说这是一个非常困难的问题故障排除,因为可能有许多变量导致与程序集相关的实际问题。
So I was working on an Outlook Add-In 2010 targeting the 32-bit version of Office. Everything was working fine until one day out of the blues, the add-in wouldn't load anymore and I was presented with error "HRESULT: 0x80131047". After searching almost half a day I found a nice article:
所以我正在开发一个针对 32 位版本的 Office 的 Outlook Add-In 2010。一切正常,直到有一天突然出现,加载项不再加载,并且出现错误“ HRESULT:0x80131047”。找了半天,发现一篇不错的文章:
http://blogs.msdn.com/b/astebner/archive/2007/05/06/2457576.aspx
http://blogs.msdn.com/b/astebner/archive/2007/05/06/2457576.aspx
I tried adding the assembly to the global cache but was unable to. Luckily, I had an almost identical project which ran just fine and I had already done comparison checks and everything seemed the same, but on this pass I found something different ... as it turned out the platform target CPU was set to 64-bitso I changed it to "Any" and voila'! - this fixed it!
我尝试将程序集添加到全局缓存中,但无法添加。幸运的是,我有一个几乎完全相同的项目,它运行得很好,我已经做了比较检查,一切似乎都一样,但是在这次通过时,我发现了一些不同的东西......因为结果平台目标 CPU 设置为64 位所以我把它改成了“ Any”,瞧!- 这修复了它!
回答by Muhammad Taqi
Yes , I just change my Project Name "Taqi's Project" to Taqi Project and It runs successfully.
是的,我只是将我的项目名称“Taqi's Project”更改为Taqi Project,它运行成功。
回答by user3541373
This MSDN forum postsays that you need to take "special" characters such as slashes, commas, or apostrophes out of your assembly name to avoid that error.
这篇 MSDN 论坛帖子说您需要从程序集名称中去除“特殊”字符,例如斜杠、逗号或撇号,以避免出现该错误。
If that doesn't fix it, another suggestion there is to uncheck "Enable the Visual Studio Hosting Process" in the Debug tab.
如果这不能解决问题,另一个建议是取消选中“调试”选项卡中的“启用 Visual Studio 托管进程”。
回答by Ivandro Ismael Gomes Jao
If you are using Assembly.Load() to load file try change it with Assembly.LoadFile() instead.
如果您使用 Assembly.Load() 加载文件,请尝试使用 Assembly.LoadFile() 更改它。
回答by Rhyous
I had an invalid App.Config file that was causing this.
我有一个导致此问题的无效 App.Config 文件。
Somehow, I was missing the final closing tag to the main element.
不知何故,我错过了主要元素的最后一个结束标签。
</Configuration>
回答by Lvpdev
I had an invalid .\Properties\licences.licx file that was causing this problem. This file is automatically generated by DevExpress components.
我有一个导致此问题的无效 .\Properties\licences.licx 文件。该文件由 DevExpress 组件自动生成。
I just deleted this file and voila: Build Succeeded.
我刚刚删除了这个文件,瞧:构建成功。

