Sharepoint. The given assembly name or codebase was invalid.

how are you all 🙂

I made a nice MSBuild Task  to automate the sharepoint deployment

the task take the the dll file, the namespace, and the ouput directory

then it goes through all the types in this namespace and generate *.webpart file for it.

today we were making the functional test.

deployment goes smooth

but when we tried to put the webpart in the sharepoint

the nice error ‘The given assembly name or codebase was invalid’

and we spent all the day trying to figure what was the error

untill our team mate Ahmed Shokr  discovered that I didn’t put the name of the type in the webpart file

and instead I’ve included the full name of the file with its token key only.


to all webpart developers

please don’t forget to put   “Type Name, Assembly Full Name”  in your webpart

or you will get into the endless war we were in today.

Happy Bugs 🙂

5 Responses to “Sharepoint. The given assembly name or codebase was invalid.”

  1. spmoran says:

    OK, I had this problem. Couldn’t figure it out. So I decided to go to a regular SP webpart and export it and then compare. first I looked for your issue, but my assembly reference was correct. It turned out that I was missing the “=” in Version= Doh! Anyway, word to the wise is export a simple webpart and compare.

  2. admin says:

    also I discovered that enabling the logging in WSS was very helpful, try to turn on the logging of the WSS it will tell you about every thing WSS is doing.

  3. Stijn says:

    Great post, this helped to fix my problem!


  4. Jorbes says:

    Thanks, didn’t see the missing ‘=’ till I read this page 🙂

  5. John Machine says:

    This post is very useful for me, much appreciated! 🙂

Leave a Reply

You must be logged in to post a comment.