Scaffolding Blazor Identity got error: An item with the same key has already been added
- Dominant language
- C#
- Stars
- 818
- Forks
- 260
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 10
Description
## File bug (related #1590)
Getting an error when scaffolding blazor-identity
Steps to reproduce:
```console
git clone https://github.com/guillaumemaka/BlazorIdentitySample.git)
cd BlazorIdentitySample/src/Blazor.Identity
dotnet restore
dotnet tool install -g aspnet-codegenerator
dotnet aspnet-codegenerator blazor-identity --databaseProvider sqlite
```
### Exception
```
Building project ...
Finding the generator 'blazor-identity'...
Running the generator 'blazor-identity'...
Empty or invalid namespace provided, using default namespace.
Added IdentityDbContext class : /Users/guillaumemaka/Developer/BlazorIdentitySample/src/Blazor.Identity/Data/IdentityDataContext.cs
An item with the same key has already been added. Key:
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.b__6_0()
at Microsoft.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.ActionInvoker.Execute(String[] args)
at Microsoft.VisualStudio.Web.CodeGeneration.CodeGenCommand.Execute(String[] args)
RunTime 00:00:04.30
```
### Sample code:
https://github.com/guillaumemaka/BlazorIdentitySample.git)
### Include provider and version information
Microsoft.AspNetCore.Identity.EntityFrameworkCore: "8.0.8"
Microsoft.EntityFrameworkCore.SqLite: "8.0.8"
Microsoft.EntityFrameworkCore.Tools: "8.0.8"
Microsoft.VisualStudio.Web.CodeGeneration.Design: "8.0.4"
Target framework: net8.0
Operating system: Mac OS Sonoma ARM64
IDE: Visual Studio Code
```
Version : 1.92.1 (Universal)
Validation : eaa41d57266683296de7d118f574d0c2652e1fc4
Date : 2024-08-07T20:16:39.455Z
Electron : 30.1.2
ElectronBuildId : 9870757
Chromium : 124.0.6367.243
Node.js : 20.14.0
V8 : 12.4.254.20-electron.0
OS : Darwin arm64 23.5.0
```
Contributor guide
Assessment
This issue has not been assessed yet.