-
Notifications
You must be signed in to change notification settings - Fork 135
Closed
Description
I set up a basic example of a .NET 6 Web API with just WatchDog installed. When I try to run the application, I get the following message:
System.InvalidOperationException
HResult=0x80131509
Message=EndpointRoutingMiddleware matches endpoints setup by EndpointMiddleware and so must be added to the request execution pipeline before EndpointMiddleware. Please add EndpointRoutingMiddleware by calling 'IApplicationBuilder.UseRouting' inside the call to 'Configure(...)' in the application startup code.
I have tested it on the example code, and I get a similar error. Here is the code from my Program.cs file:
using WatchDog;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers();
builder.Services.AddWatchDogServices();
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
app.UseWatchDogExceptionLogger();
app.UseWatchDog(opts =>
{
opts.WatchPageUsername = "admin";
opts.WatchPagePassword = "admin";
});
if (app.Environment.IsDevelopment())
{
app.UseSwagger();
app.UseSwaggerUI();
}
app.UseHttpsRedirection();
app.UseAuthorization();
app.MapControllers();
app.Run();
The error occurs on the app.UseWatchDog line.
Is there something I am missing?
Metadata
Metadata
Assignees
Labels
No labels