question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot install templates from a NuGet package on NET6

See original GitHub issue

I have a pre-existing NuGet package containing templates for dotnet new.

On .NET 6 preview, installation of the templates fails with a “No templates were found in the package” error message. On .NET 5, installation works as expected.

.NET SDK (reflecting any global.json): Version: 6.0.100-rc.1.21463.6 Commit: e627d556a1

Host (useful for support): Version: 6.0.0-rc.1.21451.13 Commit: d7619cd4b1

when I run dotnet new -i CoStar.Neo.Templates.CSharp::1.15.0-net6support.2, I get the following output:

The following template packages will be installed: CoStar.Neo.Templates.CSharp::1.15.0-net6support.2

No templates were found in the package CoStar.Neo.Templates.CSharp::1.15.0-net6support.2

When I run the same thing on the .NET 5 SDK (via a global.json file) the templates install just fine.

Trying to think of how I can provide a repro for you… perhaps I should upload my NuPkgs?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vlada-shubinacommented, May 4, 2022

We decided to close it as we won’t support NuGet dependencies for template packages in the near future. Please feel free to comment if you are blocked by this.

0reactions
ozziepeepscommented, Sep 29, 2021

I have worked around this issue by flattening my templates into a top-level NuGet package (which works on NETCORE 3.1, NET5 and on the upcoming NET6), so I am no longer blocked by this. However, please feel free to leave the issue open if you feel like this is a regression (due to the behavioral change between NET5 and NET6)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Install and manage SDK templates - .NET
Template packages are installed through the dotnet new install SDK command. You can either provide the NuGet package identifier of a template ......
Read more >
.net - why dotnet nuget packages of type template can't be ...
1 Answer. Template packages are designed to work with the dotnet new command. I believe that once a template has been installed locally...
Read more >
Unable to install template from Azure DevOps Nuget Feed
Hi, I have my dotnet template packaged and pushed to a Azure DevOps (Cloud, not on-premises server) nuget artifact feed.
Read more >
There's no option to install the Nuget Package Project ...
Sorry, my mistake. The Nuget Package Project Template is installed by the Nugetizer 3000 extension and not by the Visual Studio Installer.
Read more >
HTML5 viewer Visual Studio item template failed to add NuGet ...
Error problem occurred while trying to install the NuGet package when using HTML5 viewer item templates in Visual Studio.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found