Visual Studio unexpectedly adds a function at startup

I have a solution for SharePoint 2010 in Visual Studio 2013. Each time I close and reopen Visual Studio, a new function with one list inside it is added to the solution. The list has been removed from another function in which it should be. This is always the same list. As soon as I open the solution, it pops up in the "Exit" 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 causes this?

I tried the following:

  • Solution restored and all files copied - No change
  • Checked the display of the package and project. - Everything looks fine.
  • Loads a project in many ways, including the unload and reload command. - Without changes
  • Recreated a list that he likes to isolate in his own function - No change
  • The function in which the list should be located has been restored, but it continues to move to this new function - No change
  • Added a new list and placed it after the list of problems in this function - VS created 3 new functions! 3 lists came out of my function and put one of them into their own functions. I think I got angry.
+7
visual-studio visual-studio-2013 sharepoint sharepoint-2010
source share
2 answers

If the lists in the same function have the same type identifier, the toolkit will move the lists to the newly created function, because the Type must be unique within the function. You can check the documentation on the ListTemplate element for more information.

+7
source share

This is because functions cannot contain list templates that have the same values ​​for Type . This is explained here: https://msdn.microsoft.com/en-us/library/office/ms462947.aspx

Type of

Optional Integer.

Provides a unique identifier for the template. This identifier must be unique within the function, but not necessarily unique in all function definitions or site definitions. For a list of default list template types, see SPListTemplateType.

You 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 in the list template and list instance.

  • Change the type of the XML element of the ListTemplate to a unique integer.
  • Change the TemplateType of the xml ListInstance element to the same integer

I started choosing numbers over 1000 to avoid conflicts (although 1100, 1200, 1220 and 1221 are system types)

+5
source share

All Articles