Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

How to correctly add item to ISharePointProjectItemCollection

$
0
0

Not sure if this belongs in SP forum, but the question is related to a VS Extension implementing custom ISharePointProjectItem.

So, I have 2 custom VS ItemTemplates and have also implemented a ISharePointProjectItemTypeProvider for each. Both also have an IWizard implemented. Now, both item types work just fine when I add the item from the 'Add New Item' dialog. However, what I'm trying to do is which ItemType1 is added, during the ItemAdded event I am checking if the project contains any instances of ItemType2. If not, I want to programmatically add a new ProjectItem of type ItemType2. The check works fine, but when I use ISharePointProjectItemCollection.Add("ItemName","ItemType2") - MSDN Documentation - none of the files from ItemType2 template are added. The directory for the ProjectItem is created and has the correct custom icon and the InitializeType method for ItemType2 ISharePointProjectItemTypeProvider is hit but the directory is empty except for the auto generated 'SharePointProjectItem.spdata' file.

Do I need to manually add the template files when programmatically adding a ProjectItem or is there something else I'm missing here?


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>