简体   繁体   English

Asp.net Core Web API与MongoDB 500错误

[英]Asp.net core web api with mongodb 500 error

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. 我在Visual Studio中没有其他错误。 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 Git仓库

Github Github

Edit 编辑

Photo of IIS express warning... IIS图片警告...

在此处输入图片说明

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. 在我的代码中,我有一个postID,但我没有意识到MongoDB自动创建了一个引用为ID的ObjectID。 So when it came to calling that object ID I of course used my postID call. 因此,当涉及到调用该对象ID时,我当然使用了我的postID调用。 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. 这导致mongo DB失败,而且我没有意识到错误是在控制台窗口的顶部抛出的。 I have since updated my project in git with the necessary changes. 从那以后,我在git中更新了我的项目并进行了必要的更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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