Missing "No templates found matching:..."-message when using `-minimal` option with `dotnet new`
See original GitHub issueDescribe the bug
When using dotnet new
with the -minimal
option, no “No templates found matching:…”-message is shown to the user, if no matching template exists. Instead a generic “For more information, run:…”-message is shown.
To Reproduce
The issue can be reproduced by running dotnet new
with the -minimal
option, and a combination of template and language that doesn’t exist. The example below uses the webapi
template with -lang
option “F#”, since no minimal webapi
-template exists for F#:
$> dotnet new webapi -minimal -o TodoApi -lang F#
For more information, run:
dotnet new webapi -h
I was expecting to see a “No templates found matching:…”-message, informing me that no F#-version of this template exists, but was instead shown a “For more information…”-message.
Expected behavior
To illustrate the expected behavior, I’m including an example of trying to create a new project without the -minimal
option, using the grpc
template with -lang
option “F#”, another combination for which no template exists:
$> dotnet new grpc -o TodoApi -lang F#
No templates found matching: 'grpc', language='F#'.
To list installed templates, run:
dotnet new --list
To search for the templates on NuGet.org, run:
dotnet new grpc --search
As expected, a “No templates found matching:…”-message is printed to the console, and I would expect the behavior of dotnet new
to be similar to this when using the -minimal
option.
Further technical details
I’m using Ubuntu 20.04.3 LTS (64-bit version), and running the dotnet
command straight from the default terminal (gnome-terminal
).
The output from dotnet --info
is as follows:
$> dotnet --info
.NET SDK (reflecting any global.json):
Version: 6.0.101
Commit: ef49f6213a
Runtime Environment:
OS Name: ubuntu
OS Version: 20.04
OS Platform: Linux
RID: ubuntu.20.04-x64
Base Path: /usr/share/dotnet/sdk/6.0.101/
Host (useful for support):
Version: 6.0.1
Commit: 3a25a7f1cc
.NET SDKs installed:
3.1.416 [/usr/share/dotnet/sdk]
5.0.404 [/usr/share/dotnet/sdk]
6.0.101 [/usr/share/dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 3.1.22 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.22 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.13 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET runtimes or SDKs:
https://aka.ms/dotnet-download
Background
Discovered this bug following the Microsoft Tutorial: Create a minimal web API with ASP.NET Core. This tutorial also introduced me to the -minimal
option in .NET CLI.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top GitHub Comments
Closing. Please follow https://github.com/dotnet/aspnetcore/issues/40161 for ASP.NET template update.
This was fixed in dotnet new, removing the label