The Project Item "xyz" cannot be deployed through a Feature with Farm scope.

Monday, 19 December 2011 08:41 by Chad

Issue

Setup:

A VS 2010 solution that contains a feature scoped at Farm. You add a new Module so you can get the Elements.xml file inside it. But when you try add the Elements.xml file to the feature it's not listed, it is when you change the scope to Web, but not as Farm.

Solution

Delete the module, re-add the Elements.xml as a new Blank Element. For some reason Visual Studio tracks the Elements.xml file and knows it came from a module, which for some reason isn't allowed to be added to a Farm scoped feature.