3
Vote

Cancel Adding SharePoint Project Items unwanted side effect with TFS

description

Hi
 
We have this issue with CKS:Dev. Hope this can be fixed soon.
 
Scenario:
SharePoint project with a feature and SharePoint Project Item (for example a Web Part) added to the feature. Solution checked in to TFS and latest version downloaded by two or more developers. Solution opened in Visual Studio.
 
Steps to reproduce:
After adding a SharePoint project item (for example a Web Part) to the already existing feature and checking in the changes to TFS, the project item will be removed automatically by CKS:DEV if other team members perform a Get Latest Version on the solution (while having the previous version of the solution open in Visual Studio).
 
Workaround:
Setting Cancel Adding SharePoint Project Items to False in Options dialog (CKS Development Tools Edition)

comments

WaldekMastykarz wrote Jun 18, 2012 at 2:57 PM

What is the issue actually? This is by design and unfortunately the only way in which we can "prevent" Visual Studio from automatically adding newly added SPIs to a Feature. If you don't want this behavior, you should disable this extension, just like you mentioned in your Workaround.

JensOtto wrote Jun 18, 2012 at 5:29 PM

The issue is that after adding the SharePoint Item to the feature and checking the solution in to TFS, the SharePoint solution item should not be removed when geting the latest version from TFS in another developers workspace. This can't be by design. If a SharePoint Item has been manually added to a feature, then it should continue to be in that feature until someone manually removes it. It should never ever be automatically removed in response to a Get Latest Version from TFS.

JensOtto wrote Jun 18, 2012 at 5:40 PM

To make it even clearer: The tool (CKS:Dev) breaks the solution in the described scenario. This is true since the tool changes the solution compared to what is on TFS. This happens even if the developer does not make any changes to the solution other than performing a Get Latest Version from TFS. This could for instance happen if a merge between branches are performed, and the solution in the target branch is open in Visual Studio.

WaldekMastykarz wrote Jun 18, 2012 at 6:07 PM

This is weird behavior indeed. It would be interesting to see how Visual Studio actually notifies SharePoint developer tools of the new items. The odds are high, that because the SharePoint developer tools get the notification of a "new" SPI (which isn't new, just newly got from TFS to that particular dev machine) the event is being triggered which in result triggers of CKS:DEV. I'm not sure if we are able to make distinction between adding a new item and just Get Latest although it's definitely interesting to investigate.

Thank you for the feedback,

Waldek