[RESOLVED]There are no primary or candidate keys table 'dbo.AspNetUsers'

Hello 

how can i resolve this error , i use identity 2 and identity create id for user (UserLog is a class that i create , and i want add this table in my DB)

 when i use update-database in power shell i get this error

There are no primary or candidate keys in the referenced table 'dbo.AspNetUsers' that match the referencing column list in the foreign key 'FK_dbo.UserLogs_dbo.AspNetUsers_UserId'.

Hi Aftabi,

Thanks for your post.

Aftabi

and i want add this table in my DB)

#EF Code first adding new table to database schema without losing data

http://forums.asp.net/t/1823490.aspx?EF+Code+first+adding+new+table+to+database+schema+without+losing+data

Hope this can be helpful.

Best Regards,

Eileen

Thanks i dded priamaryKey manually in sql server and it work , but i wanted add by code , anyway thanks for your help

Leave a Reply