简体   繁体   中英

ASP.NET MVC Identity User id to int

I'm using ASP.NET Core with full .NET Framework and Identity and trying to change the user id type to int. I followed these steps ( https://medium.com/@goodealsnow/asp-net-core-identity-3-0-6018fc151b4#.1uxf4m1s8 ) and it generates right tables and columns to the DB. I get this error when running the code (locally with Visual Studio 2015) and have no idea what to do:

System.Exception: de95f9a1-0d40-4922-a19f-0f300a69955c is not a valid value for Int32. ---> System.FormatException: Input string was not in a correct format.

It tries to open the start page but fails before anything is displayed.

It seems to me that some part of the code still tries to use wrong data type for the id but I can't pinpoint what. I have my own SQL database running locally and everything was working fine until I tried to change user id to int.

Perhaps there was Identity data of an old logged user in the cookies. I had the same problem and my solution was to delete all cookies from the site and refresh the page.

I still don't know what was wrong but I just re-cloned the repo to an earlier state and remade the necessary changes as described in the linked article. Now it works. Must've made a mistake somewhere. Thanks for the help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM