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 have two features, a Content Type feature that contains the content type and list definitions, and a List feature that creates the List Instances from the list definitions. Both features auto-activate on Central Admin.

When I deploy my solution, both features are activated, and the content type/definitions are created, but the List instances are not. If I deactivate my List feature and re-activate it, the List instances are created at that point.

Any idea why they wouldn't be created on solution deployment? Within the package, the Content type feature comes before the List feature.

Edit: I've even split the List Instance creation out into another solution package. Same issue persists. I'm making sure to perform a restart of w3svc in between the deployment of the solution with the List definitions and solution with the List instances.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

If you created your list instance based on a Custom list, which you deploy in another feature (Content types & List definition in feature 1 - Site Collection Scope should be fine), and the list Instances in feature 2 (probably Web Level), then you should add another attribute (FeatureId) to your 2nd feature specifying the Id of the 1st feature. Also do not forget to have the TemplateType specified (which most like it is, but just to make sure)

Beside that, Patel's suggestion is also important, just make sure dependency is put on the 2nd Feature (Instance) by specifying GUID of 1st feature (CT & List definition one).

<ListInstance 
  CustomSchema = string
  Description = "Text"
  DocumentTemplate = integer
  **FeatureId = "<GUID of 1st FEATURE HERE>"**
  Hidden = "TRUE" | "FALSE"
  HyperlinkBaseUrl = string
  Id = Text
  OnQuickLaunch = "TRUE" | "FALSE"
  QuickLaunchUrl = "Text"
  RootWebOnly = "TRUE" | "FALSE"
  TemplateType = Integer
  Title = "Text"
  Url = "Text"
  VersioningEnabled = "TRUE" | "FALSE"
</ListInstance>

Hope it helps, C:\Marius

share|improve this answer
    
Yes, I have the FeatureId set in the List Instance Elements.xml, as well as the appropriate TemplateType from my List Definition. I'm still not seeing them created on feature activation. FWIW while I have a Receiver, I do not define FeatureActivating/Installing, only FeatureDeactivating (to delete the lists). –  Trevor Seward May 13 '12 at 3:35
    
at least from configuration standpoint you should be set. did u tried only from VS or via STSADM (manual activation) of your parent feature? it is known that Visual Studio caches configurations, etc. which occasionally induces unexpected behavior. –  C. Marius - MVP May 13 '12 at 8:37
    
Both VS and PowerShell exhibit the same issue. –  Trevor Seward May 13 '12 at 15:07
    
i'm afraid that without more details i can't help further. –  C. Marius - MVP May 13 '12 at 15:41
1  
show 5 more comments

Sounds like a dependency issue. Setting FEATURE dependency may resolve the issue. The FEATURE which creates List instance should depend on FEATURE which creates content types and list definition. Feature dependency are supported in FEATURE designer of VS.NET 2010.

share|improve this answer
    
Set an appropriate feature dep and I get the same result. The List feature is activated, but the List instances haven't been created. Deactivate the List feature, re-activate it, and the List Instances are created. –  Trevor Seward May 12 '12 at 15:13
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.