79239133

Date: 2024-11-30 08:53:48
Score: 1
Natty:
Report link

Do you not need to use AddHostedService. The default template code should work fine

Vs 2022 project creation

public class Program
{
    public static void Main(string[] args)
    {
        var builder = WebApplication.CreateBuilder(args);

        // Add services to the container.

        builder.Services.AddControllers();

        var app = builder.Build();

        // Configure the HTTP request pipeline.

        app.UseAuthorization();


        app.MapControllers();

        app.Run();
    }
}
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Zubaer Naseem