且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Asp.net核心身份"INSERT语句与FOREIGN KEY约束冲突".

更新时间:2023-02-25 22:16:31

在错误之前检查UserManager.CreateAsync调用的输出.我想您的用户不会持续存在,因此下一次通话因FK问题而失败.

Check the output of UserManager.CreateAsync call right before the error. I'm guessing your user doesn't get persisted so the next call fails with an FK issue.

如果您正在使用默认的身份密码要求(就像我尝试时一样),则会从用户创建调用中获得密码验证错误结果.

If you are using the default identity password requirements (like I was when I tried it) you get a password validation error result from the user creation call.