Visual Studio 2017自定义项目创建 [英] Visual studio 2017 custom project creation
问题描述
情况
我从系统中所有对象的遗留系统创建一个JSON文件(Data Tables,Screens e.t.c.)。我创建了一个控制台应用程序来解析这个JSON文件并为Angular / WebAPI项目创建新文件(数据模型,用于CRUD的WebAPI控制器,Angular文件等)。
目前,我创建了一个新的Angular应用程序并手动将这些文件添加到项目中。
问题
是否可以创建一个项目模板,提示用户输入JSON文件的位置,然后运行我的文件生成代码?
唯一的例子我发现自定义模板非常基本,添加文件并导出为模板。
我确信这是可能的。例如,当您创建一个新的Web应用程序时,会出现一个表单,询问项目类型,身份验证类型等,但我找不到任何有关如何实现此目的的信息。
我尝试过:
互联网搜索项目模板示例。如上所述,它们是非常基本的例子。
本文在Visual Studio中创建自己的项目模板 [ ^ ]可以帮助你。
< blockquote>您可以使用Visual Studio的自定义向导功能执行此操作,但文档很差或不存在。我写了一篇关于VS 2008主题的文章: Visual C ++ Express,自定义向导 [ ^ ]可能有助于解释一些要求。
如何:使用带有项目模板的向导| Microsoft Docs [ ^ ]
感谢Richard MacCutchan。在搜索引擎中搜索了各种术语。从来没有想过使用向导一词。
将通过这个并报告我的发现
Situation
I 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.
Problem
Is 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.
This article Create Your Own Project Template in Visual Studio[^] Might help you.
You can do this with the Custom Wizard feature of Visual Studio, but the documentation is very poor, or non-existent. I wrote an article on the subject for VS 2008: Visual C++ Express, Custom Wizard[^] which may help to explain some of the requirements.
How to: Use Wizards with Project Templates | Microsoft Docs[^]
Thanks to Richard MacCutchan. Searched various terms in search engine. Never thought to use the term "Wizard".
Will work through this and report on my findings
这篇关于Visual Studio 2017自定义项目创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!