404 on _content/Syncfusion.Blazor/styles/bootstrap4.css
404 on _content/Syncfusion.Blazor/styles/bootstrap4.css

Static assets in Razor class libraries
Razor class libraries can now include static assets like JavaScript, CSS, and images. These static assets can then be included in ASP.NET Core apps by referencing the Razor class library project or via a package reference.
To include static assets in a Razor class library add a wwwroot folder to the Razor class library and include any required files in that folder.
When a Razor class library with static assets is referenced either as a project reference or as a package, the static assets from the library are made available to the app under the path prefix _content/{LIBRARY NAME}/. The static assets stay in their original folders and any changes to the content of static assets in the Razor class libraries are reflected in the app without rebuilding.
When the app is published, the companion assets from all referenced Razor class libraries are copied into the wwwroot folder of the published app under the same prefix.
To try out using static assets from a Razor class library:
-
Create a default ASP.NET Core Web App.
dotnet new webapp -o WebApp1
-
Create a Razor class library and reference it from the web app.
dotnet new razorclasslib -o RazorLib1 dotnet add WebApp1 reference RazorLib1
-
Add a wwwroot folder to the Razor class library and include a JavaScript file that logs a simple message to the console.
cd RazorLib1 mkdir wwwroot
hello.js
console.log("Hello from RazorLib1!");
-
Reference the script file from Index.cshtml in the web app.
<script src="_content/RazorLib1/hello.js"></script>
-
Run the app and look for the output in the browser console.
Hello from RazorLib1!
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2021-12-08 Difference between pem, crt, key files
2021-12-08 Does RSA Private key always contain the Public key, or is it just .NET?
2021-12-08 Extract public/private key from PKCS12 file for later use in SSH-PK-Authentication
2021-12-08 What is PEM Format? Privacy Enhanced Mail
2021-12-08 HttpWebRequest client authentication with cert and key in pem format
2021-12-08 Converting PKCS#12 certificate into PEM using OpenSSL
2017-12-08 kentico7中设置网站的主页