'routing debugging .net core api endpoint getting 404 error

I have to debug a .net core api version 3.0 but I am not sure why it is not hitting the breakpoint in the controller. startup.cs

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }

        app.UseHttpsRedirection();
        app.UseRouting();
        app.UseAuthorization();
        app.UseEndpoints(endpoints => endpoints.MapControllers());
    }

Then in the controller I have very basic method that I need to hit

[ApiController]
[Route("[controller]")]
public class ApplicationController : ControllerBase
{
    
    [HttpGet, Route("ping")]
    public IActionResult ping()
    {
        return Ok(DateTime.Now);
    }
 }

I have set it up in the project properties like this below: enter image description here

but when I go in Postman and try to send the GET request to http://localhost:50233/controller/ping I am getting 404 response. Same when I try with http://localhost:50233/ping I get 404 error. Where does the net core 3.0 maps the routing or what should be the route for me to hit the breakpoint please.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source