title: ASP.NET Core Web API 500 Internal Server Error
body: <p>I'm trying to build an API within the ASP.NET Core framework. I've made a basic controller which just returns a string:</p>
  
  <pre><code>namespace Dojo_Api.Controllers.Forum
  {
      //[Authorize]
      [Route("api/[controller")]
      public class ForumController : Controller
      {
          private MainContext _context;
  
          public ForumController(MainContext context)
          {
              _context = context;
          }
  
          [HttpGet]
          public string Get()
          {
              return "string";
          }
      }
  }
  </code></pre>
  
  <p>Now when I try to access the API via Postman, I receive a 500 Internal Server Error:</p>
  
  <p><a href="https://i.stack.imgur.com/9oXnW.png" rel="nofollow"><img src="https://i.stack.imgur.com/9oXnW.png" alt="enter image description here"></a></p>
  
  <p>I have already tried changing the port, which didn't work. Does anyone know a solution for this problem?</p>
  
  <p>Thanks in advance!</p>