Вопрос

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