Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# .NET核心标识-不覆盖现有文件的脚手架页面_C#_Asp.net Core_.net Core_Asp.net Identity_Asp.net Mvc Scaffolding - Fatal编程技术网

C# .NET核心标识-不覆盖现有文件的脚手架页面

C# .NET核心标识-不覆盖现有文件的脚手架页面,c#,asp.net-core,.net-core,asp.net-identity,asp.net-mvc-scaffolding,C#,Asp.net Core,.net Core,Asp.net Identity,Asp.net Mvc Scaffolding,我有一个使用Identity的.NET Core 2.2 MVC应用程序。因为我使用的是Visual Studio for Mac,所以我不得不使用CLI构建标识文件。最初我只需要几个文件,所以我使用以下命令生成所需的文件: dotnet aspnet-codegenerator identity --files="Account.Manage.ChangePassword;Account.Register;Account.ResetPassword;Account.ResetPasswordC

我有一个使用Identity的.NET Core 2.2 MVC应用程序。因为我使用的是Visual Studio for Mac,所以我不得不使用CLI构建标识文件。最初我只需要几个文件,所以我使用以下命令生成所需的文件:

dotnet aspnet-codegenerator identity --files="Account.Manage.ChangePassword;Account.Register;Account.ResetPassword;Account.ResetPasswordConfirmation;Account.Manage.SetPassword;Account.Manage.Index"
我现在尝试通过运行以下命令生成另一个文件:

dotnet aspnet-codegenerator identity --files="Account.Manage.EnableAuthenticator"
但我得到了以下错误: 存在以下文件。使用“-force”覆盖:Areas/Identity/Data/SAFDtoolsIdentityDbContext.cs 区域/Identity/Pages/Account/Manage/_ManageNav.cshtml 区域/Identity/Pages/Account/Manage/ManageNavPages.cs

是否可以在不覆盖现有文件的情况下生成其他文件?我不想丢失我已经做的任何定制

此外,如果我使用--force,则只会覆盖错误中的3个文件,还是会覆盖我已生成的每个文件???

每个文件名(例如
Account.Manage.EnableAuthenticator
)包含多个文件,这些文件列在
IdentityGeneratorFileConfig.json
模板中:

当前,它似乎将覆盖现有文件,而不是查找选项来禁用该行为,您可以使用
dotnet aspnet codegenerator identity--listFiles
,它将显示需要使用
--force
覆盖的现有文件

另外,如果我使用--force,那么只有错误中的3个文件会被覆盖,或者我已经生成的每个文件都会被覆盖

它将覆盖3个文件,您可以复制/保存代码的自定义部分,将该部分代码粘贴到新创建的文件中。

每个文件名(例如
Account.Manage.EnableAuthenticator
)包含多个文件,这些文件列在
IdentityGeneratorFileConfig.json
模板中:

当前,它似乎将覆盖现有文件,而不是查找选项来禁用该行为,您可以使用
dotnet aspnet codegenerator identity--listFiles
,它将显示需要使用
--force
覆盖的现有文件

另外,如果我使用--force,那么只有错误中的3个文件会被覆盖,或者我已经生成的每个文件都会被覆盖

它将覆盖3个文件,您可以复制/保存代码的自定义部分,将该部分代码粘贴到新创建的文件中