I’ve finally managed to find time recently to get stuck in to some SharePoint 2010 development. I have started work on a Silverlight application for ID which will interact with SharePoint and run in an out of the box ‘Silverlight Web Part’ (more on this soon!).
I had a number of issues when attempting to create List Definitions from Content Types using the inbuilt Visual Studio 2010 SPI functionality. Some of these may be bugs and others might be down to the configuration of my environment. Either way I thought I’d summarise the issues that I had here in case anyone else has the same problems.
- I created a Content Type SPI and configured the elements.xml. I then proceeded to add a new item to the project – ‘List Definition from Content Type’. Rather than the usual wizard that connects to your SharePoint site I simply got an error message – ‘There are no Content Types in the project’. Creating a new solution and project seemed to fix this bizarre error/bug.
- I followed this MSDN article – Create Custom List Definitions in SharePoint 2010 but when the solution is deployed it does not work as expected. The ‘Bug’ Content Type gets created but does not appear on the new menu of the list and content types appear to not be enabled on the list. This seems to be because the article does not instruct you to put EnableContentTypes=”True” and DisallowContentTypes=”FALSE” into the Elements.xml files.
- If you create a List Definition from a Content Type using the wizard – the content type will not show up on the list unless you add the above two properties in the Elements.xml files of the List Definition and List Instance.
Again I’m not sure if these are bugs so I’m not going to rush off and raise them on the Microsoft Connect site just yet!
Hope this helps!