1

I used to do standard MVC3/EF4, and took a few years out... and it seems so much has changed.

I created a new app using MVC5 - it started fast and works, I then added my EF models and I got a warning that the schema had changed and I need to use Migrations (looks exciting!).... I am a little confused as I hadn't launched a controller so I don't understand when/how it built the EF model.

Anyway, I figured out that the new MVC5 authentication uses EF out the box, and I figured it was related to that (so much to learn now!) - as I only had one test user, I thought I would just drop the database and allow the application to rebuild everything.

So, I deleted it and relaunched...

In my main Chrome session, I had the logged in cookie, and it is now coming up with a "Object reference not set to an instance of an object." enter image description here

The moment I clear my cookies or use incognito, it clears it - and I can create users again/the models get created as expected.

My debugger isn't firing and I can't figure out what is actually breaking here...

Can anyone shed any light on this?

wil
  • 1,691
  • 2
  • 12
  • 14
  • 1
    YSOD is cool, but you'd better post text version (and add steps you tried from http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it) – Alexei Levenkov Jan 29 '15 at 03:38
  • I posted the exact steps I did from new project to error - create project, run/test, create model, run, delete db, rerun - error... The debugger isn't firing and it seems related to the cookie of the old session - I just don't understand why. Not sure YSOD is that relevant, just didn't want to miss in case someone did ask for it! And thanks, that post looks AMAZING, I will take a read now – wil Jan 29 '15 at 03:42
  • Catch the exception and read the CookieExceptionContext. My guess would be a failed lookup of the SecurityStamp due some assumption that User X exists. – rism Jan 29 '15 at 04:13

0 Answers0