Adding Solution Items to the Project Template Wizard

I am trying to add a file to the Solutions folder in Visual Studio using the Project Template Wizard. I can create the folder myself, but when I add the file it doesn't do anything.

My code (executed from ProjectFinishedGenerating

) -

    fullPath = @"path_to_existing_file";


Where _solutionFolder is the project instance corresponding to the solution folder.


source to share

1 answer

I fell into the same trap. You need to add it to ProjectItems:

var _solutionFolder = _vsSolution.AddSolutionFolder(folder);


Note, I have not tried the above code. I am adapting it from my code (which works in AddIn):

Dim project As EnvDTE.Project = _vsSolution.AddSolutionFolder(folderName)
_folder = CType(project.Object, SolutionFolder)




All Articles