Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I noticed there are a lot of new project and item templates in Visual Studio 2010, but I'm unable to find one for Site Columns. Is there none? What's the suggested way of making a site column in VS2010+SP2010?

share|improve this question
add comment

2 Answers

up vote 2 down vote accepted

You just add an empty element and rename it to fields.xml, then add your field declarations:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <Field
    ID="{[add guid]}"
    Name="[addName]"
    StaticName="[addInternalName]"
    DisplayName="[addInternalName]"
    Type="Text" />
</Elements>
share|improve this answer
add comment

A complete Walkthrough on how to create your own project template for a site column:

share|improve this answer
    
I've followed that first walkthrough exactly and ended up with the following error on the very last step (go figure) "VSIX Manifest Editor - Adding this project as a reference would cause a circular dependency" When trying to add [Select a content type] MEF Component [Select a source - Project] ProjectItemTypeDefinition Any ideas? –  user1840915 Mar 1 '13 at 4:41
1  
As a matter of fact there is a SPI template for fields available out of the box. You should be able to see its type after importing a WSP generated by SharePoint when saving a site as template or by importing some fields using CKS:DEV. The way you can use it is to create an empty element and then change its type in the .spdata file. The File SPI Template doesn't provide any specific functionality as far as I know so you could as well keep using the Empty Element SPI Template. –  Waldek Mastykarz Mar 2 '13 at 10:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.