سؤال

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