When I create a project using a template I created myself, the document cannot be opened appears when the file is opened. It has been renamed, deleted or moved "error prompt.
It seems that this bug is only in the community version.
At this point we need to manually modify the template file
Here's how I solved this issue:
- Follow your steps 1 to 6
- At Step 7 make sure to uncheck "Automatically import the template into Visual Studio"
- Click Finish
- Extract the just created zip file of your template into a folder of your choice
- Now copy all your source (. cpp) and headers (. h) files from your original SFML project to the extracted folder
- In this folder look for mytemplate.vstemplate and open it in a text editor
- You'll see a templatedata and templatecontent sections
- Inside the templatedata section add the line <CreateInPlace>true</CreateInPlace>
- Inside the templatecontent section add for each copied file from step 5 the lines
<projectitem replaceparameters= "false" Targetfilename= "filename.cpp" >filename.cpp </ProjectItem> or
<projectitem replaceparameters= "false" Targetfilename= "filename.h" >filename.h</ Projectitem>
- Now put all files back into a zip file
- Copy your new zip file to Visual Studio 2015\templates\projecttemplates folder
- Restart Visual Studio and open a new project from your project template
Reference from: https://social.msdn.microsoft.com/Forums/vstudio/en-US/24b38dbb-c445-47a4-a05b-c9c12cfa6a6b/ Visual-studio-community-2015-source-file-missing-from-template?forum=vssetup
VS2017 Community Create template Error The document cannot be opened. It has been renamed, deleted or moved