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

See Can site columns be deployed in sandboxed solutions? for background on this.

I've tried to reproduce the sandboxed feature with a site column as built by Hilton Giesenow shown on How Do I: Create a Site Column in Visual Studio 2010. 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?

I found an article that made me think that ensuring the name of the empty element matched the Field element's name attribute would do the trick:

The Name attribute of the WebTemplate element will have to exactly the same as the name of your Empty Element in Visual Studio. If these two don’t match the web template won’t deploy properly.

I renamed the element node in my project to "OrderIndex" to match the name of my site column, and that didn't work either.

Update: after doing some more looking, I found Walkthrough: Create a Custom Field, Content Type, List Definition, and List Instance on MSDN. I pretty much followed exactly the directions in the "Custom Field" section.

share|improve this question
    
What's the error you're getting? –  James Love Nov 9 '11 at 20:54
    
No error. The column just doesn't appear in the Site Column Gallery. –  Ben Collins Nov 9 '11 at 20:58
    
Check the ULS logs for the moments after you activate the Feature, there should be some clues there. –  James Love Nov 9 '11 at 20:58
    
Alright. I found this: Solution Deployment : Missing one or more of the following attributes from the root node in solution XXXXXXX.wsp: assembly '', type ''. According to the internets this is an ambiguous message that means roughly something like "your sandboxed solution contains unsupported somethings-or-other". One person had restricted code, and another suggested it might be unsupported attributes in the Field element. Not sure what they would be. –  Ben Collins Nov 9 '11 at 22:13
add comment

1 Answer

up vote 0 down vote accepted

Finally found the answer, which is summed up neatly by Phil Harding in SharePoint Integer and Numeric Field (Site Column) Types.

Bottom line: it was working all along, just not visible in the Site Column Gallery (which means it could only be used in content types, not in UI-built custom lists). If you want it to show up in the gallery, you have to use a type marked with UserCreatable = TRUE.

My column still isn't in the Gallery, but here's what PowerShell has to say about it:

PS C:\Users\Administrator> $site.RootWeb.Fields |? {$_.Group -eq "XXXX"} | ft InternalName,Type

InternalName                 Type
------------                 ----
OrderIndex                   Integer
share|improve this answer
add comment

Your Answer

 
discard

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

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