dotnet / sdk

Core functionality needed to create .NET Core projects, that is shared between Visual Studio and CLI
https://dot.net/core
MIT License
2.7k stars 1.06k forks source link

Output from `dotnet new library` doesn't include classlib #12375

Open jaredpar opened 4 years ago

jaredpar commented 4 years ago

For whatever reason my brain wants to use dotnet new library to create C# class libraries. My error aside the output from that command is not really actionable. The output spans multiple pages of text and doesn't actually include the standard C# class library template. This is true if you use the term "library" or "lib". There are plenty of other libraries included in the output like NuGet library, Razor Library and even a C# class library from a NuGet package but not the actual C# class library template.

KathleenDollard commented 4 years ago

@jaredpar We think alike on this.

In our current/previous "choose your own adventure" version , there were 3 possible outcomes of a mismatched template depending on whether you matched nothing, a few things, or only one thing. Some of those responses were walls of text.

Starting in .NET SDK 5.0.100, we are updating this experience, changing our perspective to giving you what is immediately relevant and better switches to get the specific information you want. Specifically we have a --search (-s) available which will replace the search that was the source for your wall of text.

This work is https://github.com/dotnet/templating/pull/2391, and perhaps other PRs.

Does that cover it?

KathleenDollard commented 4 years ago

@grinrag

jaredpar commented 4 years ago

I'm not aware of an issue to rename the classlib template, but I'm not against the idea

I wouldn't rename it on my account. My main concern is that when using the wrong term I get no feedback on what the correct one is. If we gave a general "not a valid command" error that would be fine. But instead we print out info on a lot of different class library options, none of which are the standard C# library.

That is where my confusion is. We recognize, or at least give the appearance of recognizing, the user wanted to create a library but don't help them find the correct one.

Yes, we are still using switches for dotnet new. Aligning with the rest of dotnet is on the list

Not sure what "switches" means here.

rainersigwald commented 4 years ago

I thought I'd asked for library but what I actually asked for was dll (because that's how my brain is stuck :)): dotnet/templating#318.