18 Jun 2010
Deployment claims site column already exists on the site or site collection
I’m currently working on a project and one part of the project contains the site definitions, site columns and content types defined in xml files. At some point I started to get deployment errors telling me that a certain site column already exists on the site or site collection. Retracting the solution did not help even while the the site column dissappeared in the site column list. After trying a lot of things it seems that changing the ID of the site column removed the problem. Setting it back the next time to the original ID was giving me the error again.
After doing some research it seems that SharePoint 2010 / Visual Studio 2010 is using some kind of stale cache keeping the deployed site columns in memory for some time. I came accross an answer of Mujahid Hasan-MSFT – SDE, Visual Studio at a Microsoft forum. He suggested the following two workarounds:
Workaround 1:
• Right click on Project node in Solution explorer and click “Retract“. This will retract the Field.
• Close VS. This will flush the stale cache.
• Open the project in a new instance of VS and re-deploy the solution.
If closing VS after retract doesn’t solve the problem then a longer workaround is:
Workaround 2:
• Redeploy the project -> This will show an error during feature activation.
• Go to “Manage Site Features” under “Site Settings” in SharePoint UI in the browser.
• Activate and then Deactivate the deployed feature which contains the Field.
• Retract the Solution in VS i.e. right click on the Project node and click “Retract”.
• Close VS. This will flush the stale cache.
• Open the project in a new instance of VS and re-deploy the solution. This should work.
The workarounds work but it makes your life difficult. Closing VS is not an option for me. Lets hope that this will be fixed in the feature service packs.


















