It's a trap It's a trap - 1 year ago 86
C# Question

Input string was not in a correct format error on using int keys

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

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.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download