0

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

Simon Mourier
  • 132,049
  • 21
  • 248
  • 298
elector
  • 1,327
  • 4
  • 26
  • 43
  • Maybe this kind of folders are invalid for specif projects? Did you try `vsProjectItemKindVirtualFolder`? What is you project type? – outcoldman May 11 '13 at 07:24
  • The folder kind is optional, have you tried to omit it? Otherwise, what type of project are you targeting? – Simon Mourier May 14 '13 at 07:24

2 Answers2

1

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);
ygormutti
  • 358
  • 3
  • 17
elector
  • 1,327
  • 4
  • 26
  • 43
0

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.

edocetirwi
  • 542
  • 5
  • 22