Sounds like the request is being handled before it’s able to reach ServiceStack. Is your app.UseServiceStack(new AppHost()) registered at the start of the pipeline?
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
if (!app.Environment.IsDevelopment())
{
app.UseExceptionHandler("/Error");
app.UseHsts();
app.UseHttpsRedirection();
}
app.UseServiceStack(new AppHost());
app.Run();
but if I add in:
[assembly: HostingStartup(typeof(ConfigureHangfire))]
namespace Project.Configure;
public class ConfigureHangfire : IHostingStartup
{
public void Configure(IWebHostBuilder builder)
{
builder.Configure(app =>
{
});
}
}
Then all the ServiceStack routes like /ui and /metadata stop working. I tried making a branch with ServiceStack 8 to see if any difference but it’s the same behaviour.
The IHostingStartup classes are run before Program.cs so it might be hijacking the request, preventing it from reaching ServiceStack. Does it work when you configure Hangfire after ServiceStack?
app.UseServiceStack(new AppHost());
app.UseHangfireDashboard("/hangfire", new DashboardOptions
{
Authorization = new[] { new HangFireAuthorizationFilter() }
});