C
C#5mo ago
nox7

How Can I Debug ASP Core Controller Registered, but Not Matching?

I have started a basic ASP Core MVC project in VS. Set up a basic test controller, and visited the endpoint; but I get a 404 response status page instead. (Screenshot of ASP Debug logs attached) How can I further debug why my controller is registered (being found with AddControllers/MapControllers) but not being selected? Controller code is below. Screenshots of outputting the app's known controller classes attached.
using Microsoft.AspNetCore.Mvc;

namespace StripeWebhookHost.Controllers
{
public class TestController : Controller
{
[HttpGet]
public IActionResult Test()
{
return Content("Hello");
}
}
}
using Microsoft.AspNetCore.Mvc;

namespace StripeWebhookHost.Controllers
{
public class TestController : Controller
{
[HttpGet]
public IActionResult Test()
{
return Content("Hello");
}
}
}
No description
No description
No description
1 Reply
nox7
nox7OP5mo ago
I'm just silly. The attribute needed a blank string in the argument for HttpGet. It works now.
Want results from more Discord servers?
Add your server