dotnet / templating

This repo contains the Template Engine which is used by dotnet new
https://docs.microsoft.com/dotnet/
MIT License
1.63k stars 369 forks source link

dotnet new command changes in net6.0 #4825

Closed heng-liu closed 2 years ago

heng-liu commented 2 years ago

Describe the bug

There are few dotnet new command works in .NET 5 but fails in .NET 6.

To Reproduce

  1. Install .NET 5 SDK and .NET 6 SDK(6.0.300) in different paths with no path, then set DOTNET_MULTILEVEL_LOOKUP=0, and invoke them separately
  2. Template reactredux disappears from .NET 6 if running dotnet new --list command. But doc doesn't mention this change.
    C:\net5\dotnet.exe new reactredux
    The template "ASP.NET Core with React.js and Redux" was created successfully.
    C:\net6\dotnet.exe new reactredux -n reactredux1
    No templates found matching: 'reactredux'.
  3. Template solution could not use solutionanymore, only slnworks.
    C:\net5\dotnet.exe new solution -n Solution1
    The template "Solution File" was created successfully.
    C:\net6\dotnet.exe new solution -n Solution2
    No templates found matching: 'solution'.

Exceptions (if any)

Further technical details

dotnet-issue-labeler[bot] commented 2 years ago

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

vlada-shubina commented 2 years ago

This is by design. Starting .NET 6.0 it is only possible to use exact 'short name' to instantiate template. For solution template, the only short name is sln. Partial name or short name matching led to much confusion. This was implemented in https://github.com/dotnet/templating/issues/3113.

We may add the alternative short name solution to this template though. @baronfel thoughts?

heng-liu commented 2 years ago

Thanks @vlada-shubina ! May I know if Template reactredux is removed from .NET 6?

baronfel commented 2 years ago

@vlada-shubina adding the additional name makes sense here 👍

vlada-shubina commented 2 years ago

Thanks @vlada-shubina ! May I know if Template reactredux is removed from .NET 6?

I do not see this template in .NET SDK 6.0.3xx. You may check in https://github.com/dotnet/spa-templates/ what is the status for this template.

vlada-shubina commented 2 years ago

@vlada-shubina adding the additional name makes sense here 👍

I added the new issue specifically for this: https://github.com/dotnet/templating/issues/4874. Closing the current issue as the behavior is by design. Please feel free to comment in case of further concerns.