Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't add item template to project via Visual Studio Add -> New Item... #4148

Closed
Matejprica opened this issue Nov 25, 2021 · 4 comments
Closed

Comments

@Matejprica
Copy link

Hi there, I'm not really sure whether this feature exists or not and I'm having trouble finding a clear answer online. I've created an item template for a certain class with dotnet CLI and packed it into a nuget package. When I install the package i can clearly see the template class in CLI list of templates and create it via CLI with dotnet new MYTEMPLATE command. But I don't see it in Visual Studio i.e. I can't add it to my existing project through Visual Studio by right clicking on project and selecting Add -> New Item... . I've also created a template project by the same analogy and after installing the nuget package I can see and select my template project from "New project menu". Am I missing some parameter in template.json? I have set all the required params as well as type for project as project and type for item as item.

@sayedihashimi
Copy link
Member

Showing Item Templates from dotnet templates in VS isn’t currently supported. It should be technically possible in 17.1, but in an unsupported way. We are having discussions to get changes into the Template Engine for .net 7. The idea is that we will switch the implementation at that point. That’s why we are not currently documenting, and supporting, Item Templates.

@Matejprica
Copy link
Author

Wow that was a really fast reply. Thank you very much!

@seangwright
Copy link

@sayedihashimi Are .NET CLI Item Templates supported in Visual Studio now? If, not are there any public plans or roadmap to support them?

@sayedihashimi
Copy link
Member

@seangwright see this comment and the comments that follow it #4686 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants