简体   繁体   中英

Can't find template installed by nuget in visual studio 2019

I want to install Antlr4 Console App template mentioned inhere ,and nuget console tell me that I install it sucessfully.

But I can't find this template in create new project menu. enter image description here

And I try to install it again,but nuget tell me "The template "Antlr4 Console App" was created successfully."

The VS IDE does not contain the Antlr4 Console App template automatically. And it is for dotnet cli project template automatically(using command line to create).

If you want to create Antlr4 Console App template for VS IDE, you should follow these steps:

1) open CMD as Administrator and then type this to create the template for dotnet cli:

dotnet new -i Antlr4BuildTasks.Templates::8.9.1

then ,

cd xxxx(a default empty folder which for the created project by dotnet cli)
dotnet new antlr

2) open the created antlr project by VS IDE

在此处输入图像描述

After that , click VS top menu Project --> Export Template --> Project Template

在此处输入图像描述

Input the info like my description and then click Finish .

3) Close VS, copy the generated Antlr4 Console App.zip file into C:\Users\xxx\Documents\Visual Studio 2019\Templates\ProjectTemplates\Visual C# :

在此处输入图像描述

4) restart VS and click new project.

For newly added templates, VS search and location are not too accurate, so often the template is at the end of the search results,

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM