Why is [Owin] throwing a null exception on new project?

前端 未结 16 1376
孤城傲影
孤城傲影 2020-12-25 10:01

I have a rather strange issue i\'m not sure how to fix or if i can even fix it.

I\'ve done some research into the issue but can\'t find an answer to what\'s causing

相关标签:
16条回答
  • 2020-12-25 10:41

    i missed to add the roles in the table [AspNetRoles]. That solved the issue.

    0 讨论(0)
  • 2020-12-25 10:42

    These answers all seem helpful and to indicate a trend that the database is messed up. I got this issue because I had updated my model and hadn't updated the database. Right now I'm calling Add-Migration and Update-Database manually each time I change the model and before I try to debug my site and I had forgotten that step.

    0 讨论(0)
  • 2020-12-25 10:42

    I had the same problem and it happened because the SQL database is behind a firewall and you need to add your local IP every time it changes.

    See this link from Microsoft for all the ways to do that:

    http://msdn.microsoft.com/en-us/library/azure/jj553530.aspx

    0 讨论(0)
  • 2020-12-25 10:47

    Running the following updates after creating a new project worked for me:

    update-package Microsoft.Owin

    update-package Microsoft.Owin.Security

    update-package Microsoft.Owin.Security.Cookies

    I think the last one might have been enough. I am using Visual Studio 2013 (12.0.21005.1) and the ASP.Net Web Application template with Web API.

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