The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)

by APIJunkie 20. December 2007 10:25

If you are trying to use an ASP.NET web custom control and you receive the above error.

Make sure that you specify the name of the assembly and not the complete or partial path to the assembly in the register directive.

Example:

Lets assume you have a name space called MyNameSpace and a dll file called MyNameSpace.dll that contains that name space.

The following 2 variations will produce this error:

<%@ Register TagPrefix="MyNS" Namespace="MyNameSpace" Assembly="~/Bin/MyNameSpace.dll" %>

<%@ Register TagPrefix="MyNS" Namespace="MyNameSpace" Assembly="~/Bin/MyNameSpace" %>

The problem is that you must not use the path or file name of the dll in the assembly property of the register directive.

To solve the problem only specify the assembly name in the assembly property of the register directive:

<%@ Register TagPrefix="MyNS" Namespace="MyNameSpace" Assembly="MyNameSpace" %>

 

Tags:

.NET | ASP.NET

Comments

12/20/2007 11:21:38 AM #

trackback

Trackback from DotNetKicks.com

The given assembly name or codebase was invalid

DotNetKicks.com

11/7/2008 5:19:25 PM #

renu

Error  1  Feature 'da049734-2bc1-4ba8-8aeb-670cd22773f5' could not be installed because the loading of event receiver assembly "FeaReceiver, Version=1.0.0.0 Culture=Neutral Public key token=9f4da00116c38ec5" failed: System.IO.FileLoadException: Could not load file or assembly 'FeaReceiver\, Version\=1.0.0.0 Culture\=Neutral Public key token\=9f4da00116c38ec5' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
File name: 'FeaReceiver\, Version\=1.0.0.0 Culture\=Neutral Public key token\=9f4da00116c38ec5'
   at System.Reflection.AssemblyName.nInit(Assembly& assembly, Boolean forIntrospection, Boolean raiseResolveEvent)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
   at Microsoft.SharePoint.Administration.SPFeatureDefinition.get_ReceiverObject()

renu United States

6/9/2010 7:41:18 AM #

J-Hawk

I am new to visual basics and i can not figure out how to fix this problem. I dont know how to change the assmbly. I keep running into the same problem but i dont know how i created it or how to get rid of it. Please help...step by step

J-Hawk United States

7/27/2010 9:20:33 AM #

Gunnar

Another solution: if you are referring classes or assemblies with strong-name key then make sure that the whole string is correct and does not contain any typos.

Gunnar Estonia

Comments are closed

About the author

Name of author

I was first wounded by x86 assembly, recovered and moved on to C. Following a long addiction to C++ and a short stint at rehab I decided to switch to a healthier addiction so I am now happily sniffing .NET and getting hooked on Silverlight.

I am mainly here to ramble about coding, various API’s, Junkies(me especially) and everything else that happens between coders and their significant other.

  James Bacon