Common SharePoint Errors: Reasons and Solutions

Ok here you can find a short sample list of the issues I ran into during my development work. I will not go into detail but feel free to ask me if you have any question.

Error:


“The security validation for this page is invalid. Click Back in your Webbrowser, refresh the page, and try your operation again”

Reason:

You are trying to do an unsafe update (either add, delete or modify an object).

Solution:

You need to set the following attribute to true on the SPSite.
SPSite.Current.Web.AllowUnsafeUpdates = True

Good practice:

Remember to set it back to false as soon as the operation is done.

For more information visit:

http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.allowunsafeupdates.aspx

------------

Error:

“Value cannot be null. Parameter name: key “

Reason:

Your custom DLL is not recognized.

Solution:

1.Make sure your SafeControl entry has valid information (version, public tokenkey and etc)
2.Add namespace in the project property and update the “Inherits” attribute in SafeControl Tag

---------------

Error:

“The group name is empty, or you are using one or more of the following invalid characters: " / \ [ ] : < > + = ; , ? * ' @ “

Reason:

The name property is not set.

Solution:

In my case, I was trying to add a new RoleDefinition. So all I did was to set the name property of the new RoleDefinition. I’m sure you can apply the same solution to your scenario.

---------------

Error:

“FieldType is not installed properly. Go to the list settings page to delete this “

Reason:

The DLL and the definition class is not available.

Solution:

1- Make sure the class specified for the field type is right and accessible (either in the GAC or Bin folder)
2- Trim the property tags down to only the ones you need which usually are: TypeName,ParentType,TypeDisplayName,TypeShortDescription,UserCreatable, FieldTypeClass

------------------

Error:

“Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)) “

Reason:

Can’t find the underlying type (in my case field) or control

Solution:

In my case I was trying to define a field type and I only had defined the BaseFieldControl. You should have a field type inherited from an SP field type (e.g. SPFieldText, etc)

------------

Error:

“The default namespace 'http://schemas.microsoft.com/WebPart/v2' is a reserved namespace for base Web Part properties. Custom Web Part properties require a unique namespace (specified through an XmlElementAttribute on the property, or an XmlRootAttribute on the class). “

Reason:

The WebPart XML file doesn’t have the definition for your custom property.

Solution:

1.Delete and repopulate the DWP file
2.Use V3 WebPart definition (.webpart) over V2 (.dwp)

-------------

Error:

This page has encountered a critical error. Contact your system administrator if this problem persists.
Reason:

Underlying DLL is not found.

Solution:

Check Public token key and other attributes in SafeControl tag located in Web.Config

-------------

Error:

WebPartManager.AddWebpart(...) ZoneIndex is not picked up or misbehaves

Reason:

WebPart Manager is not saved.

Solution:

After changing the orders try SaveChanges() on the WebPart Manager. If it didn’t work, move the WebParts to the right zone index and then save WebPart Manager Changes.

Taking a moment to introduce myself!

Who am I?

If I ask that every single day, the answer will always be different. Don't get me wrong I'm don’t have an unstable personality, it's just that the way I look at life evolves every single day which to me is an indication that I'm still alive.

What you may want to know though is that I'm 24 years old, immigrated to Canada from Iran few years ago and am currently working as a Technical consultant in an IT consulting company in Toronto. I have BSc from Azad University of Tehran South, and am a part-time student at Seneca college (have been for the last 4 years or so, to sharpen my skills).


What am I doing here?

when I started learning SharePoint I came across amazing articles that really helped me to move through my issues, and this for me a is a chance to pay my dues, log my experience and just get my thoughts out.

What's my focused?

I've been switching around various technologies but I would call myself expert (or would like to think that way) in the following areas:

1- Data warehousing, SSIS, SSAS, SQL
2- .Net, Ajax, query
3- MOSS & WSS (SharePoint)

In this weblog I'll focus on the last two. Hopefully I'll start another weblog for my data warehousing experiences soon!


My next post will be some random issues that I have come across during my SharePoint development experience. I'll share the error, reason for the failure and the possible solution.

So see ya then! :)