码迷,mamicode.com
首页 > 编程语言 > 详细

VS2017 community创建模板错误 The document cannot be opened. It has been renamed, deleted or moved

时间:2018-08-05 18:07:27      阅读:329      评论:0      收藏:0      [点我收藏+]

标签:mis   files   star   错误提示   add   doc   出现   name   Edito   

当我使用我自己创建的模板生成工程,打开文件时,会出现“The document cannot be opened. It has been renamed, deleted or moved”错误提示。

好像这个bug只在community版本中。

这时我们需要手工去修改模板文件

Here‘s how I solved this issue:

    1. Follow your steps 1 to 6
    2. At step 7 make sure to uncheck "Automatically import the template into Visual Studio"
    3. Click Finish
    4. Extract the just created zip file of your template into a folder of your choice
    5. Now copy all your source (.cpp) and header (.h) files from your original SFML project to the extracted folder
    6. In this folder look for MyTemplate.vstemplate and open it in a text editor
    7. You will see a TemplateData and TemplateContent section
    8. Inside the TemplateData section add the line <CreateInPlace>true</CreateInPlace>
    9. 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>
    10. Now put all files back into a zip file
    11. Copy your new zip file to Visual Studio 2015\Templates\ProjectTemplates folder
    12. Restart Visual Studio and open a new project from your project template

参考自: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创建模板错误 The document cannot be opened. It has been renamed, deleted or moved

标签:mis   files   star   错误提示   add   doc   出现   name   Edito   

原文地址:https://www.cnblogs.com/xiyu714/p/9426458.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!