Exception from HRESULT: 0x80131047

25

I am having this problem whenever I try to debug my project:

Visual Studio error dialog

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)"

Can anyone help me please?

c#
c
hresult
asked on Stack Overflow Sep 20, 2012 by Omarrrio • edited Jan 3, 2020 by Adrian Mole

8 Answers

35

If you are using Assembly.Load() to load file try change it with Assembly.LoadFile() instead.

answered on Stack Overflow Nov 25, 2016 by Ivandro Jao
18

Project > Project Properties > Name > remove the "'" from the name, and it will work :)

answered on Stack Overflow Sep 21, 2012 by Omarrrio
10

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:

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-bit so I changed it to "Any" and voila'! - this fixed it!

answered on Stack Overflow Apr 30, 2013 by Leo Gurdian • edited Apr 30, 2013 by Leo Gurdian
3

Yes , I just change my Project Name "Taqi's Project" to Taqi Project and It runs successfully.

answered on Stack Overflow Oct 6, 2013 by Muhammad Taqi
3

I had an invalid .\Properties\licences.licx file that was causing this problem. This file is automatically generated by DevExpress components.

I just deleted this file and voila: Build Succeeded.

answered on Stack Overflow Apr 11, 2018 by Lvpdev
2

This MSDN forum post says that you need to take "special" characters such as slashes, commas, or apostrophes out of your assembly name to avoid that error.

If that doesn't fix it, another suggestion there is to uncheck "Enable the Visual Studio Hosting Process" in the Debug tab.

answered on Stack Overflow May 6, 2014 by user3541373
2

I had an invalid App.Config file that was causing this.

Somehow, I was missing the final closing tag to the main element.

</Configuration>
answered on Stack Overflow Mar 16, 2018 by Rhyous
0

For anyone else that stumbles across this article and determines that their naming convention is correct and they are using the LoadFile method...

Here is the solution I came up with:

byte[] data = System.IO.File.ReadAllBytes(filename);
Assembly assembly = Assembly.Load(data);
answered on Stack Overflow May 4, 2021 by The Modulator

User contributions licensed under CC BY-SA 3.0