-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Closed
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsquestion
Description
Background
So my goal is to create a simple Blazor WinForms app.
My current project setup:
- BlazorComponents - RCL (shared between BlazorServer and BlazorDesktop)
- BlazorServer - just to debug RCL project using browser DevTools
- BlazorDesktop - WinForms app with Blazor WebView
Currently, I am prototyping, and I've tried
- Create a default .Net 9 Blazor Web App with server-side
- Create a default .Net 9 RCL project
- Remove everything from RCL project
- Move
wwwroot
andComponents
from BlazorServer to RCL project.
I've made it work, but I have a problem with CSS imports as you can see:

CSS import errors:

My App.razor
file:
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<base href="/"/>
<link rel="stylesheet" href="@Assets["lib/bootstrap/dist/css/bootstrap.min.css"]"/>
<link rel="stylesheet" href="@Assets["app.css"]"/>
<link rel="stylesheet" href="@Assets["BlazorServerTest.styles.css"]"/>
<ImportMap/>
<link rel="icon" type="image/png" href="favicon.png"/>
<HeadOutlet/>
</head>
<body>
<Routes/>
<script src="_framework/blazor.web.js"></script>
</body>
</html>

Project to reproduce: https://github.com/Morasiu/BlazorServerTest
So my question is. How can I use new Assets
syntax to reference my CSS files?
Metadata
Metadata
Assignees
Labels
✔️ Resolution: AnsweredResolved because the question asked by the original author has been answered.Resolved because the question asked by the original author has been answered.Status: Resolvedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentsquestion