First i want to assure you that i have already read many posts with similar title on SO.
I have created an ASP.NET MVC project and changed the keys of template tables to int following this article
http://www.asp.net/identity/overview/extensibility/change-primary-key-for-users-in-aspnet-identity
But i am getting a runtime error in this line of StartUp.Auth.cs
getUserIdCallback: (id) => (id.GetUserId<int>()))
Error = System.FormatException: Input string was not in a correct format. Any help is appreciated.
Input string was not in a correct format error occurs when you convert non-numeric data into an int or exceed the limit of the int data type. You should use Int. TryParse instead of Int32. Parse method to get rid of the said error.
String input templates allow you to specify the type, order, and number of characters a user can enter in a data entry field. You can define string input templates only on single‑line character data entry fields.
कुछ ऐसा जो योग्य स्थिति में नही है ।
I know it's a late response. But for people who may encounter this in the future: Clear your cache or switch to a different browser.
Although you changed the pk from string
to int
in the code and updated Identity
related tables, the cookie was still the one you logged in with string pks.
To get rid of this error you need to clear cookies for your site.
Chrome: F12 -> Application -> Storage -> Cookies -> your site -> Clear
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With