Question

I am recreating an AddIn project that I had in VS 2010 and a basic function like adding a folder to the project is not working. Giving me:

The kind 'vsProjectItemKindPhysicalFolder' passed to ProjectItems.AddFolder is invalid.

Does anyone know how to solve this?

Thank you

Was it helpful?

Solution

The problem is that you need to pass in the constant named vsProjectItemKindPhysicalFolder and not the name of the constant as a project type:

proj.ProjectItems.AddFolder(@"Generated", EnvDTE.Constants.vsProjectItemKindPhysicalFolder);

OTHER TIPS

This is most likely because you already have a folder by that exact name on the physical disk, but is not part of the project yet. You should try renaming the existing folder and try doing that action again.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top