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

Inconsistent casing of template parameters #40970

Closed
1 task done
nohwnd opened this issue Mar 31, 2022 · 9 comments · Fixed by dotnet/spa-templates#107 or #45816
Closed
1 task done

Inconsistent casing of template parameters #40970

nohwnd opened this issue Mar 31, 2022 · 9 comments · Fixed by dotnet/spa-templates#107 or #45816
Labels
area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels feature-templates help wanted Up for grabs. We would accept a PR to help resolve this issue
Milestone

Comments

@nohwnd
Copy link
Member

nohwnd commented Mar 31, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Template for grpc uses Framwork, which becomes --Framework and -F rather than --framework and -f that other templates use, e.g. console, mstest, winforms.

https://github.com/dotnet/aspnetcore/blob/main/src/ProjectTemplates/Web.ProjectTemplates/content/GrpcService-CSharp/.template.config/template.json#L53

The settings are case-sensitive on purpose:

dotnet/templating#3237
dotnet/templating#3238

Expected Behavior

Please consider using, -f framework.

Steps To Reproduce

C:\t\grpc1> dotnet --version
7.0.100-preview.2.22153.17

C:\t\grpc1> dotnet new grpc --help
ASP.NET Core gRPC Service (C#)
Author: Microsoft
Description: A project template for creating a gRPC ASP.NET Core service.

Usage:
  dotnet new grpc [options] [template options]

Options:
  -n, --name <name>       The name for the output being created. If no name is specified, the name of the output directory is used.
  -o, --output <output>   Location to place the generated output.
  --dry-run               Displays a summary of what would happen if the given command line were run if it would result in a template creation.
  --force                 Forces content to be generated even if it would change existing files.
  --no-update-check       Disables checking for the template package updates when instantiating a template.
  -lang, --language <C#>  Specifies the template language to instantiate.
  --type <project>        Specifies the template type to instantiate.

Template options:
  -F, --Framework <net5.0|net6.0|net7.0|netcoreapp3.1>  The target framework for the project.
                                                        Type: choice
                                                          net7.0         Target net7.0
                                                          net6.0         Target net6.0
                                                          net5.0         Target net5.0
                                                          netcoreapp3.1  Target netcoreapp3.1
                                                        Default: net7.0

Exceptions (if any)

No response

.NET Version

7.0.100-preview.2.22153.17

Anything else?

No response

@javiercn
Copy link
Member

@nohwnd thanks for contacting us.

That's a good catch, feel free to send us a PR if you want to address it.

/cc: @JamesNK

@javiercn javiercn added area-grpc Includes: GRPC wire-up, templates feature-templates area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Mar 31, 2022
@JamesNK
Copy link
Member

JamesNK commented Mar 31, 2022

This isn't unique to gRPC template. All the web templates have Framework.

e.g.

@javiercn
Copy link
Member

@JamesNK so is there inconsistency then or not? 😄.

As long as the parameter shows as --framework on the output I think its correct.

I believe you need to look at this file or equivalent in the GRPC template.

It might be that on the GRPC template is missing the parameter definition

@JamesNK
Copy link
Member

JamesNK commented Mar 31, 2022

Ah, so the inconsistency is this is missing from grpc's dotnetcli.host.json:

@nohwnd
Copy link
Member Author

nohwnd commented Mar 31, 2022

FWIW all the templates I have locally use --framework except for grpc.

This is the full list of templates that have capitalized parameters, are some other managed here as well? :)

C:\Users\jajares> dotnet new web --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new grpc --help | sls -CaseSensitive "-[A-Z]"

  -F, --Framework <net5.0|net6.0|net7.0|netcoreapp3.1>  The target framework for the project.

C:\Users\jajares> dotnet new webapi --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new webapp --help | sls -CaseSensitive "-[A-Z]"

  -S, --SignedOutCallbackPath <SignedOutCallbackPath>         The global signout callback (use with IndividualB2C auth).

C:\Users\jajares> dotnet new mvc --help | sls -CaseSensitive "-[A-Z]"

ASP.NET Core Web App (Model-View-Controller) (C#)
  -S, --SignedOutCallbackPath <SignedOutCallbackPath>         The global signout callback (use with IndividualB2C auth).

C:\Users\jajares> dotnet new angular --help | sls -CaseSensitive "-[A-Z]"

  -P, --ProxyPort <ProxyPort>          Port number to use for the SPA front-end development proxy.

C:\Users\jajares> dotnet new react --help | sls -CaseSensitive "-[A-Z]"

  -P, --ProxyPort <ProxyPort>          Port number to use for the SPA front-end development proxy.

C:\Users\jajares> dotnet new reactredux --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new blazorserver --help | sls -CaseSensitive "-[A-Z]"

  -S, --SignedOutCallbackPath <SignedOutCallbackPath>         The global signout callback (use with IndividualB2C auth).

C:\Users\jajares> dotnet new blazorwasm --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new classlib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new console --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new gitignore --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new tool --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new editorconfig --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new globaljson --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new mstest --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new viewimports --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new viewstart --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new nugetconfig --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new nunit --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new nunit --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new proto --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new proto --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new razorclasslib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new razorcomponent --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new page --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new sln --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new webconfig --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new winforms --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new winformslib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new winformscontrollib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new worker --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new wpf --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new wpflib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new wpfcustomcontrollib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new wpfusercontrollib --help | sls -CaseSensitive "-[A-Z]"
C:\Users\jajares> dotnet new xunit --help | sls -CaseSensitive "-[A-Z]"

I got the full list using dotnet new --list, and then just edited that using the VSCode multiselection magic...

@rafikiassumani-msft rafikiassumani-msft added this to the 7.0-preview6 milestone Mar 31, 2022
@rafikiassumani-msft
Copy link
Contributor

Triage: Should we make all these cases insensitive? @DamianEdwards

@DamianEdwards
Copy link
Member

@rafikiassumani-msft yeah I think that makes sense.

@ghost
Copy link

ghost commented Aug 4, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@rafikiassumani-msft rafikiassumani-msft added the help wanted Up for grabs. We would accept a PR to help resolve this issue label Aug 4, 2022
@JamesNK JamesNK changed the title --Framework is not consistent with --framework other templates use Inconsistent casing of template parameters Dec 22, 2022
@JamesNK
Copy link
Member

JamesNK commented Dec 22, 2022

gRPC is fixed (--Framework vs --framework)

I've renamed this issue to be generic to other templates with parameters than need to be looked at.

@JamesNK JamesNK removed the area-grpc Includes: GRPC wire-up, templates label Dec 22, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Feb 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-web-frameworks *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels feature-templates help wanted Up for grabs. We would accept a PR to help resolve this issue
Projects
None yet
5 participants