I programmed several files. I want to add them to a visual studio project. I have a link to a project (DTE.Project). When I execute the code below, an error message appears.
project.ProjectItems.AddFromFile(filename);
Error
Exception at 'Expand' - 'Unable to add 'manage.txt'. A file with that name already exists.' System.Runtime.InteropServices.COMException (0x80040400): Unable to add 'manage.txt'. A file with that name already exists. at EnvDTE.ProjectItems.AddFromFile(String FileName)
When I transfer the call to try-catch, the process ends, but no files are added to the project. I need to manually show hidden files and then include them in the project.
How to add a file for this?
source share