Cannot install templates from a NuGet package on NET6
See original GitHub issueI 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:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
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.
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)