Skip to content

Dashboard CSS returns 404 in API-only project #2886

Description

@oronf-mda

Describe the bug

In a Web API project, if I add the Quartz.Dashboard package and set it up, the CSS returns 404 at /_content/Quartz.Dashboard/css/quartz-dashboard.css. This causes the UI to completely break.

Version used

Quartz 3.16.1
.NET 8.0

To Reproduce

Starting with an existing ASP.NET Core Web API project that does not have a UI framework.

<Project Sdk="Microsoft.NET.Sdk.Web">
	<PropertyGroup>
		<TargetFramework>net8.0</TargetFramework>
		<GenerateDocumentationFile>true</GenerateDocumentationFile>
		<NoWarn>$(NoWarn);1591</NoWarn>
		<Nullable>enable</Nullable>
		<ImplicitUsings>enable</ImplicitUsings>
		<RequiresAspNetWebAssets>true</RequiresAspNetWebAssets>
	</PropertyGroup>
	<ItemGroup>
		<PackageReference Include="Quartz" Version="3.16.1" />
		<PackageReference Include="Quartz.AspNetCore" Version="3.16.1" />
		<PackageReference Include="Quartz.Dashboard" Version="3.16.1" />
		<PackageReference Include="Quartz.Serialization.Json" Version="3.16.1" />
                ...
	</ItemGroup>
        ...
</Project>
builder.Services.Configure<QuartzOptions>(builder.Configuration.GetSection("Quartz"));

builder.Services.AddQuartz(q =>
{
    ...
});
builder.Services.AddQuartzDashboard();
...
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseAntiforgery();

app.MapControllers();

app.MapQuartzDashboard();

Expected behavior

The UI should be functional out of the box.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions