I am trying to create a site column in VS2010 without using features. Is this possible? If yes, please let me know where I can start looking.

I don't want to use feature because feature comes with its own maintainability headache which I want to avoid as much as possible. I want to be able to individually install/update/delete each site column that I create in any given environment.

  • Another way is to use SharePoint APIs and do it using code. Commented Jul 5, 2011 at 17:52
  • Ashish, could you suggest a web-site or a textbook that can help me go down this path? Thank you. Commented Jul 5, 2011 at 18:36

2 Answers 2


If you are just trying to avoid using declarative xml to create the column, you can write C# code to create the column. But to deploy to your site through a wsp, it will still need to be packaged in a feature.

You could write a console application that runs on the server and executes the code to create the column. However, this seems like more of a maintainability headache than creating a feature.

Either way, the code would look something like this:

using(SPSite site = new SPSite("url-of-your-site"))
  using(SPWeb web = site.RootWeb)
    web.Fields.Add("ColumnName", SPFieldType.Text, true);

You could also create a Powershell script to add the column. Something like:

$site = Get-SPSite "your-site-url"
$web = $site.RootWeb 
$column = '<Field Name=...' +
                 'ID=...' +
                  etc. +

But, really features aren't that bad once you accept that feature activation is the way to programmatically add elements to a SharePoint site.

  • Laurie, thank you for your answer. This is very helpful. I think I will give the console app a try. The reason I am not very happy about features is because I cannot delete one site column or content type from a given featuer - hence, as an end user I dont have much control over my own artifacts. The same issue will arise during upgrades for me as a developer. Commented Jul 5, 2011 at 18:54

You can create columns in three ways:

  • I have created the columns using both the UI and Features. But since both these approaches are kind of rigid per maintainability, I would like to try the Object Model. To that end, I have not found a definitive guide that can help me jump start this project. Commented Jul 5, 2011 at 18:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.