Skip to content

dotnet new generates project in src folder #1270

Description

@Swimburger

Describe the bug

dotnet new generates project in src folder, handling the --name and --output parameter incorrectly.

Let's use the following command as example 1:

dotnet new serverless.AspNetCoreMinimalAPI --name MyLambdaMinimalApi --output .

And the following as example 2:

dotnet new serverless.AspNetCoreMinimalAPI --name MyLambdaMinimalApi --output MyFolder

Expected Behavior

1: The expected result would be to generate the project files in the current folder because --output ., but the project name should be MyLambdaMinimalApi.csproj.
2: The expected result would be a folder MyFolder with the project files in it including the MyLambdaMinimalApi.csproj project file.

Current Behavior

1: The actual result is an src folder with a MyLambdaMinimalApi subfolder, with the project files in it.
2: The actual result is a MyFolder folder with a src subfolder, with a MyLambdaMinimalApi subfolder, with the project files in it.

Reproduction Steps

(Commands above)

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

Lambda templates 6.2.0

Targeted .NET Platform

.NET 6

Operating System and version

macOS 12.5

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions