CS0103 C# The name 'Json' does not exist in the current context

Question: How do you solve the error "The name 'Json' does not exist in the current context in Asp.Net 5 Web API.

Answer: Use ActionResult as a return type and not IActionResults. Make sure that your API Controller is inheriting from Controller and Not ControllerBase. Comment below if this helped you or if there is something we should help you with.

 


Edit this Article
.Net 5 Web API Json Asp.net core .NET 5 published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy