Error occurred in deployment step Activate Features: Invalid file name
This is one of those “d’oh” SharePoint moments. Created a new SharePoint feature and used Visual Studio to deploy it. Worked like a dream. Great, I think, ready for UAT. Package up the solution, install to the UAT environment and then attempt to activate the feature. Boom.
Weird. The feature was very simple so the error, as is the wont of SharePoint, was a bit unhelpful. Quick bit of Googling which didn’t help, before, thankfully, my brain engaged. I checked to see if what my feature was trying to do - create a site column and attach it to a couple of content types - had actually worked. It had.
So the issue here was - well, not really an issue at all. It’s because the feature was set to auto activate (in Visual Studio). Hence, I deployed the solution, and it activated. I tried to reactivate it but of course the feature file does already exist - hence the error. The unhelpful thing is that in Manage Site Features, the feature looks like it’s not activated.
Change the setting, and you’re good to go.