I am totally new to ASP.NET MVC 5 and I need some help.
Background:
I am building my own web site because I would like to productise it eventually.
It's a form of eating your own dog food.
I have created a default application (you know, the one with all the MS links) and am modifying it for my own needs.
The first thing I did is what you should NEVER do :) i.e. modify the database tables manually to add roles and give my spanking new user the admin role. I did google but either I asked it the wrong question or
missed the link totally. Either way, I modified them manually and it
seemed to "work" (i.e. no db integrity errors were raised in Visual Studio).
I then added a "Products" table and did the scaffolding from the model to the controller, views, etc (thanks Mr Google). I also found how to stop
showing links in the Index view for the data manipulation if you're not an
admin.
Now, as I implied, I had registered a user, so I was curious to see what
would happen when I returned and tried to call (from URL) my brand new toy.
That's when a very useful "Object reference not set..." came up.
I have therefore a few questions:
- Did I do anything stupid (likely)?
- If I did, what is it?
The stack trace does not mention anything to do with login or errors in the db, except for the following lines:
Microsoft.Owin.Security.Cookies.CookieAuthenticationProvider.Exception(CookieExceptionContext context) +49
Microsoft.Owin.Security.Cookies.<AuthenticateCoreAsync>d__2.MoveNext() +3698
which are just below the main line detailing the error.
So, if I am correct, it tried to access a cookie it didn't find.
What do you think is the most likely cause of this issue?
Suggestions?
[UPDATE]
Ok, so I have tried digging a bit to see whether I could find something interesting... and eventually I did.
Buried in one of the many files, I found this comment:
Note the authenticationType must match the one defined in
CookieAuthenticationOptions.AuthenticationType
Which seems to match with the stack trace outlined above.
I did check and it seems to me that they are the same(thanks to Google I found where to look).
I am stuck.
Please help!