Skip to content

Blazor project templates use inconsistent Bootstrap folder structure across VS2022 (Windows) and .NET CLI (Mac/Linux) #63701

@ycfay

Description

@ycfay

Description
When creating a new Blazor Server or Blazor WebAssembly project, the Bootstrap library is restored into different folder structures depending on whether the project was created in Visual Studio 2022 on Windows or using the .NET CLI on Mac/Linux.

This leads to missing styles (404 bootstrap.min.css) when the same project is opened on another platform, because the default _Layout.cshtml (or index.html) hardcodes a specific path.

Steps to reproduce
On Windows with VS2022:
Create a new Blazor Server App (using default template).
Observe that Bootstrap is placed in:
wwwroot/lib/bootstrap/dist/css/bootstrap.min.css

On Mac (or Linux) using CLI:
Run:
dotnet new blazorserver -o RazorDemo
cd RazorDemo
Observe that Bootstrap is placed in:
wwwroot/lib/bootstrap/css/bootstrap.min.css
Copy the project between Windows and Mac.
Run the app.
Notice that styles are missing due to path mismatch.

Expected behavior
Both templates should use the same folder structure for Bootstrap (e.g., consistently wwwroot/lib/bootstrap/dist/css/).
This will prevent cross-platform inconsistencies and missing styles.

Actual behavior
VS2022 (Windows) → dist/css/
.NET CLI (Mac/Linux) → css/
Causes missing styles when the project is shared or moved across platforms.

Environment
.NET SDK: 9.0.303 (Mac), 9.0.7 runtime installed
Visual Studio 2022 (Windows)
macOS 15 / Windows 11

Additional context
This looks like a project template / LibMan configuration mismatch.
It would help if the templates were unified or _Layout.cshtml used a consistent reference.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackThe author of this issue needs to respond in order for us to continue investigating this issue.Status: No Recent Activityarea-blazorIncludes: Blazor, Razor Components

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions