Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
421 views
in Technique[技术] by (71.8m points)

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

I want to install Antlr4 Console App template mentioned in here,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."

question from:https://stackoverflow.com/questions/65650907/cant-find-template-installed-by-nuget-in-visual-studio-2019

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

enter image description here

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

enter image description here

Input the info like my description and then click Finish.

3) Close VS, copy the generated Antlr4 Console App.zip file into C:UsersxxxDocumentsVisual Studio 2019TemplatesProjectTemplatesVisual C#:

enter image description here

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,

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...