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

有帮助吗?

解决方案

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);

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top