I have created a package in Visual Studio 2010 for SharePoint 2010 which contains a single feature, called "SiteColumns", which link to a single elements file defining a single site column.

I have verified in the feature designer that the elements file is referenced, and I have verified in the package designer that the feature is included, and I am able to deploy, but the site column doesn't appear in the site column gallery.

According to Use Visual Studio 2010 To Create SandBoxed Site with Content, site columns can't be deployed in sandboxed solutions, but according to http://msdn.microsoft.com/en-us/library/gg615463.aspx, they can.

Which is it? And what do I have to do to get it to work?

Update: According to a couple of the commenters below, it appears that declarative xml elements are allowed in sandboxed solutions. So that partially answers the question in one sense. However, I've tried to reproduce the sandboxed feature with a site column as built by Hilton Giesenow shown here. When I used a content type project like he did, it worked as he shows. However, if I start with an empty sharepoint project and add an empty element file (which creates a feature much like he shows in his video), it doesn't work.

I opened up the resulting WSPs and compared the XML. What I found was that the packages were identical with the exception of the GloballyAvailable property set to "True" on the feature built in the content type project like Giesenow did. I added that property to my feature, rebuilt the packages, and compared the resulting XML and found no differences other than feature names/IDs. I redacted some of the naming to keep a client anonymous.

Comparison of WSP files

Now what? Why does one work and not the other?

Update 2: I've migrated the "why doesn't this work" part of this question to a new question and marked an answer for this one, since it's technically answered now. See Why won't my site column deploy from an elements file? for the followup.

1 Answer 1


Yes, you can include site columns and content types in a sandboxed solution. See How Do I: Create a Site Column in Visual Studio 2010? for a demonstration.

Update (Feb 8, 2017): As the comment by sschoof indicates, the content I linked to in my original answer is no longer available. Please refer to Walkthrough: Create a Site Column, Content Type, and List for SharePoint instead.

Here is a screen capture from that article:

Screen capture from article

  • Yes, I've seen that video. What I don't like about it is that he starts with a content type element, and I don't think I should have to do that (I followed the same steps, except with an elements file instead of a content type, and it didn't work). Have you ever successfully deployed a site column in a sandboxed solution just using an elements file? Commented Nov 8, 2011 at 5:02
  • When you say "except with an elements file instead of a content type", do you mean that you used the Empty Element item template? If you follow the steps in the video and use the Empty Element item template instead of the Content Type item template it should work just fine. Commented Nov 8, 2011 at 6:24
  • Just add the elements file to a Feature, it works in Sandboxed. Commented Nov 8, 2011 at 6:32
  • 1
    Further, the link that you've interpretted to mean that Site Columns can't be deployed actually says "Fields". I think it's talking about custom field types which, afaik, can't be deployed in Sandbox
    – Andy Burns
    Commented Nov 8, 2011 at 8:59
  • 1
    @sschoof I've updated my answer with an alternate resource Commented Feb 8, 2017 at 15:16

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.