Tuesday, September 22, 2009

WSPBuilder AddIn Error

If you get an error from WSPBuilder when trying to copy a DLL to the GAC or recycle an app pool that says "System.Reflection.TargetInvocationException" and looks like this:



just make sure that ALL app pools are started -- if any one is down you'll receive this error.

Wednesday, September 9, 2009

Microsoft.SharePoint.WebControls.BaseChoiceField.Validate()

When you see this error, it's likely due to the fact that the Page Layout you're using has controls on it that are not in the Content Type that you're tying it to:

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
Microsoft.SharePoint.WebControls.BaseChoiceField.Validate() +501
System.Web.UI.Page.Validate() +141
Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ConsoleAction.EnsureItemSavedIfEditMode(Boolean forceSave) +200
Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PublishAction.RaisePostBackEvent(String eventArgument) +167
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

Wednesday, August 26, 2009

Using Andrew Connell's stsadm commands to make Content Type and Site Column features

When using Andrew Connell's custom stsadm commands, I've found that you need to do the following to make a working Site Column and Content Type feature:

For Site Columns, run the GenSiteColumnsXml command (using groupFilter helps get your custom ones), and then in the resulting xml, remove any columns that have the "Version" attribute. Then create your feature.xml:








and then put your site columns into your elements.xml:







For Content Types, do the same thing, only after pasting in from the GenContentTypesXml command, remove XmlDocuments Node from each ContentType:




ListForm
ListForm
ListForm




That should do the trick!