简体   繁体   中英

Blazor Server : How to access css file(s) of RazorClassLibrary from Blazor?

In my sample Blazor server project, I'm using dynamic assembly loading, to load my RazorClassLibrary dll file into my main blazor server project. This works correctly but i don't know how to load static files of my razorClassLibrary project such as css. Where is the problem & how to solve this? Thanks in advance

My Razor Class library is called Library .

Set a dependency in the web project to the class library.

Add a link in _Layout.cshtml

    <link href="_content/library/css/library.css" rel="stylesheet" />

Note that's: _content/ project-name / where-off-wwwroot

Here's a screenshot showing the browser Dev tools: 在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM