本文介绍了Visual Studio 2017自定义项目创建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 情况 我从系统中所有对象的遗留系统创建一个JSON文件(Data Tables,Screens e.t.c.)。我创建了一个控制台应用程序来解析这个JSON文件并为Angular / WebAPI项目创建新文件(数据模型,用于CRUD的WebAPI控制器,Angular文件等)。 目前,我创建了一个新的Angular应用程序并手动将这些文件添加到项目中。 问题 是否可以创建一个项目模板,提示用户输入JSON文件的位置,然后运行我的文件生成代码? 唯一的例子我发现自定义模板非常基本,添加文件并导出为模板。 我确信这是可能的。例如,当您创建一个新的Web应用程序时,会出现一个表单,询问项目类型,身份验证类型等,但我找不到任何有关如何实现此目的的信息。 我尝试过: 互联网搜索项目模板示例。如上所述,它们是非常基本的例子。解决方案 您可以使用Visual Studio的自定义向导功能执行此操作,但文档很差或不存在。我写了一篇关于VS 2008主题的文章: Visual C ++ Express,自定义向导 [ ^ ]可能有助于解释一些要求。 SituationI create a JSON file from a legacy system of all the objects in a system (Data Tables, Screens e.t.c.). I have created a console application that parses this JSON file and creates new files for an Angular/WebAPI project (Data Models, WebAPI controllers for CRUD, Angular files e.t.c.).At the moment, I then create a new Angular application and manually add these files into the project.ProblemIs it possible to create a project template that will prompt the user for the location of the JSON file and then run my file generation code?The only examples I can find for custom templates are very basic, adding files and exporting as a template.I'm sure this is possible. When you create a new Web Application for example, a form is presented asking for project type, authentication type e.t.c., but I can't find any information on how to achieve this.What I have tried:Internet searches for Project Template examples. As mentioned above, they are very basic examples. 解决方案 这篇关于Visual Studio 2017自定义项目创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
07-29 17:37
查看更多