Asp.net core web api with mongodb 500 error

2019-09-07 23:03发布

问题:

I have been following this tutorial here. With some help I have finally completed it and attempted to deploy locally on my machine. I get the following error...

I get no other errors in Visual studios. I am rather new to this so my question is this, How do I diagnose this type of error? I am happy to provide code if necissary, thanks in advance for any help given.

Git repo

Github

Edit

Photo of IIS express warning...

回答1:

I have figured out my issue. In my code I have a postID, What I didn't realize was that MongoDB auto creates an ObjectID referenced as ID. So when it came to calling that object ID I of course used my postID call. This caused the mongo DB to fail, Also I didnt realize the error was being thrown way up at the top of my console window. I have since updated my project in git with the necessary changes.