dotnet / dotnet/Scaffolding

Creating a MVC controller with CRUD views adds second connection string to appsettings.json

Open
#3,712 0 comments 0 reactions 0 assignees View on GitHub
area-dotnet-scaffolding customer-reported
Dominant language
C#
Stars
818
Forks
260
Avg merge
1d 8h
Merged PRs (30d)
10

Description

(No code for this, result of running `dotnet scaffold` interactively.

Go through to create controller & views: find.

But my `appsettings.json` has been modified with a new connection string referencing SQL Server Local DB (as created by the project wizard). But there is already a `DefaultConnection` connection string referenced by project startup.

Why did scaffolding add this setting that isn't used in a way that is inconsistent in its naming from the project wizard?

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue by running `dotnet scaffold` interactively to create a controller and CRUD views, then inspect the resulting `appsettings.json` alongside the existing `DefaultConnection` used by project startup. Trace why the SQL Server Local DB connection string is added and determine whether the duplicate setting and inconsistent naming should be changed.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.