Reputation: 581
I have a .NET Core 2.2 MVC app using Identity. Since I'm using Visual Studio for Mac I had to use the CLI to scaffold out the identity files. Initially I only needed a few files so I used the following command to generate the files I needed:
dotnet aspnet-codegenerator identity --files="Account.Manage.ChangePassword;Account.Register;Account.ResetPassword;Account.ResetPasswordConfirmation;Account.Manage.SetPassword;Account.Manage.Index"
I'm now trying to generate another file by running:
dotnet aspnet-codegenerator identity --files="Account.Manage.EnableAuthenticator"
but I get the following error: The below files exist. Use '--force' to overwrite: Areas/Identity/Data/SAFDtoolsIdentityDbContext.cs Areas/Identity/Pages/Account/Manage/_ManageNav.cshtml Areas/Identity/Pages/Account/Manage/ManageNavPages.cs
Is it possible to generate additional files without overriding existing files? I don't want to lose any customizations I already made.
Also, if I use --force will only the 3 files in the error get overwritten or will every file I already generated be overwritten??
Upvotes: 1
Views: 1872
Reputation: 27578
Each file name(for example Account.Manage.EnableAuthenticator
) contains several files which list in identitygeneratorfilesconfig.json
templete:
Currently it seems will overwrite the existing files and not find option to disable the behavior , you can use the dotnet aspnet-codegenerator identity --listFiles
, it will show the exist files which need to use --force
to overwrite .
Also, if I use --force will only the 3 files in the error get overwritten or will every file I already generated be overwritten??
It will overwrite the 3 files and you can copy/save the customize part of codes , paste that part of codes to new created files .
Upvotes: 3