Can't add Health Checks #5229
-
I can't configure asp.net core Health Checks with a IServerStartup class due to the order in which they are executed. This would be the IServerStartup implementation public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
app.UseEndpoints(endpoints =>
{
endpoints.MapHealthChecks("/health");
});
}
public void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks();
} And it throws this error on startup:
Basically, this occurs because this logic is invoked before UseRouting and all the other middleware in Oqtane.Server startup: // execute any IServerStartup logic
app.ConfigureOqtaneAssemblies(env); Is there any way to circumvent the issue? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
@mdmontesinos currently there is no way to resolve this |
Beta Was this translation helpful? Give feedback.
-
@sbwalker Wait, so there's also no way to add minimal APIs to Oqtane, right? That is unfortunate... |
Beta Was this translation helpful? Give feedback.
-
@mdmontesinos actually there is always a way with open source... you can fork the project and modify the core framework to meet your own requirements |
Beta Was this translation helpful? Give feedback.
-
@mdmontesinos correct, there is currently no way to add minimal APIs to Oqtane - however anything you need to accomplish in a Minimal API can be accomplished using a traditional API - so technically there is no limitation (other than developer preference) |
Beta Was this translation helpful? Give feedback.
-
Right, thanks for the answer. |
Beta Was this translation helpful? Give feedback.
-
@mdmontesinos I experimented with moving the IServerStartup logic later in the Configure method... which would allow for additional endpoints to be registered:
And this appears to work fine for the core framework... and for a variety of custom modules in my environment. This change would only potentially cause issues for custom modules which are dependent upon the current location where this is called in Startup. Thoughts? |
Beta Was this translation helpful? Give feedback.
@mdmontesinos currently there is no way to resolve this