Input string was not in a correct format - wrong context is used

前端 未结 1 760
清酒与你
清酒与你 2021-01-19 07:25

After changing ASP.NET Core Identity to use int rather than GUID (as per this blog post) I am receiving the following error:

ArgumentExce

相关标签:
1条回答
  • 2021-01-19 07:46

    As per one of the comments in the blog post:

    Thank you, this article was really useful. One gotcha for me was that after swapping to use an int when I first loaded identity server again I got an error on this line

    Microsoft.AspNetCore.Identity.UserStoreBase.ConvertIdFromString(string id).

    Turns out I had a cookie using the old guid format, simple fix was to clear cookies.

    The issue is that some of your previous logins were likely done when the ID was a GUID. You changed it to int, and so now it doesn't know how to handle the GUID any more. The simplest solution will be to delete your cookies, effectively logging you out and forcing you to login again (using int instead).

    0 讨论(0)
提交回复
热议问题