I have a SharePoint 2010 solution in Visual Studio 2013. Every time I close and reopen Visual Studio, a new feature is added to the solution with one list inside it. The list was removed from another feature that it should be in. It is always the same list. As soon as I open the solution this pops up in the Output window before I do anything...
A new feature Feature2 has been added to the project Solution
C:\Code\Solution\Package\Package.package (0,0): Added Feature2 to Package
What is causing this?
I have tried the following:
- Recreated the solution and copied all files over - No change
- Checked the package and project manifest. - Everything looks okay.
- Loaded the project every different way, including unload and reload command. - No change
- Recreated the list it likes to isolate into its own feature - No change
- Recreated the feature the list should be in but it keeps moving to this new feature - No change
- Added a new list and put it after the problem list in the feature - VS then created 3 new features! It took 3 lists out of my feature and put one in each of its own features. I guess I made it angry.
If the lists in the same feature have the same Type ID, the tooling will move the lists into a newly created feature, because the Type must be unique within a feature. You can check the documentation on the
ListTemplate
element for more information.It is because features cannot contain list templates that have identical values for
Type
. This is explained here: https://msdn.microsoft.com/en-us/library/office/ms462947.aspxYou will probably find that your Elements.xml file for your list templates contains the same value for Type.
To fix this, you will need to edit the Elements.xml files of the list template and the list instance.
I have started to choose numbers over 1000 to avoid conflicts (Although 1100, 1200, 1220 and 1221 are system types)