0

I add a folder to wwwroot in Visual Studio 2022 and Blazor .NET 9.

My project is blazor server side, but after debug, this folder doesn't get served. I can't use fonts in the CSS.

This my CSS :

@font-face {
    font-family: BNazanin;
    src: url(Fonts/BNazanin.TTF);
}

@font-face {
    font-family: BNazaninBold;
    src: url(Fonts/BNazaninBold.TTF);
}

@font-face {
    font-family: BNazaninOutline;
    src: url(Fonts/BNazaninOutline.TTF);
}

@font-face {
    font-family: BTitr;
    src: url(Fonts/BTitrBold.TTF);
}

And it doesn't show this folder devtools in the browser:

enter image description here

enter image description here

3
  • 2
    The very picture you posted proves that static folders like js, lib and bootstrap-icons are served. Did you forget to set font files' Build Action or Copy to Output Folder properties? Commented Feb 26 at 8:55
  • I Set on Fonts files Copy Always in Copy to Output file in properties .. but nothing happen. what is meaning of build action ? Commented Feb 26 at 9:31
  • Try emptying your cache and doing a hard reload in your browser. It may have cached an older version. Commented Feb 26 at 11:59

2 Answers 2

0

folders in Browsers devtool dont show folder like visual studio folders. i must check link for checking serving static files. for this question i must check url http://host/Fonts/BTitrBold.TTF.

Sign up to request clarification or add additional context in comments.

Comments

0

Leaving comment as answer as low on rep. Is your site actually using it? Checked network tab for any failed requests? When you publish do you see them in the output? Is your site using the correct version of that CSS file that loads the fonts?

The sources tab doesn't show what is on the server, it shows what has been loaded from the server(s).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.