Tuesday, September 23, 2008

My daily SharePoint frustration - V

The error message:

Could not load type 'Blah.Control'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)

at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)
at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)

The context:
I was trying to create a custom field type with a custom control. The problem appeared when I was trying to create a new column in a list. Apparently SharePoint wasn't finding the class for the inheritance of the control, declared in the ascx file.

The solution (or workaround):
I checked that the public key token was the same in the GAC, in the ascx.
I checked that the FieldTypeClass in the field declaration was correct in my fldtypes_blahblahblah.xml
I reset IIS. (I think this is what "solved" the problem). It is as if resetting IIS forced SharePoint to "reconsider" the proper version of the assembly in the GAC (flushed whatever from memory).

No comments: