abp icon indicating copy to clipboard operation
abp copied to clipboard

When creating new solution through ABP CLI: -cs/--connection string parameter must be wrapped in double quotes in abp new command

Open 008programmer opened this issue 8 months ago • 3 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Description

When running the abp new command with the -cs (connection string) parameter, the connection string must be wrapped explicitly in double quotes for the command to work correctly. If not, it results in an error.

Reproduction Steps

Create a new simple project through cli e.g. **abp new PRABH.PEOPLE -u blazor -scp -dbms PostgreSQL -o PRABH.PEOPLE -cs Host=localhost;Port=5432;Database=PRABH.PEOPLE;User ID=postgres;Password=123456

Expected behavior

Either clearly mention this requirement in the documentation,

Or update the CLI to handle the -cs parameter consistently without requiring quotes, like other options.

Actual behavior

Image

Regression?

No response

Known Workarounds

Putting the -cs value in Double quotes solves this problem. like

abp new PRABH.PEOPLE -u blazor -scp -dbms PostgreSQL -o PRABH.PEOPLE -cs "Host=localhost;Port=5432;Database=PRABH.PEOPLE;User ID=postgres;Password=123456"

Version

0.9.26

User Interface

Common (Default)

Database Provider

EF Core (Default)

Tiered or separate authentication server

None (Default)

Operation System

Windows (Default)

Other information

No response

008programmer avatar Jun 08 '25 15:06 008programmer

hi

Because the connection string may contain spaces and other characters, double quotes are needed.

maliming avatar Jun 09 '25 00:06 maliming

@maliming

Yes, you are correct, but I believe we should explicitly use double quotes in the documentation examples, since people often copy and paste directly from the docs. Unlike other key values that don't require quotes, this is a specific case where double quotes are necessary.

I'm suggesting this from the perspective of a new developer trying out ABP for the first time — this clarification will help them get started more confidently without running into avoidable issues, especially since the error message in this case doesn’t provide much guidance.

008programmer avatar Jun 14 '25 16:06 008programmer

hi

I updated the CLI document.

https://github.com/abpframework/abp/pull/23068

Thanks.

maliming avatar Jun 16 '25 01:06 maliming