Blazor Shared Resources Naming Requirement

October 7, 2022
blazor dev

If you're trying to link a shared Blazor/Razor library for CSS, images, JS, etc., you need to name it correctly.

And that probably seems logical. naming it wrong will ALWAYS result in not finding what yu want. If you call your wife Terry, which is not her name, she won't answer. And if she does, well, that may have preferred she didn't.

So what's the correct naming? Lucky for you, I know this because I've trying to figure it out for 45 minutes. It's the name of the project.

You're welcome.

Oh, you knew that? Of course, why wouldn't you. everyone says it over and over. The name of the project. The name of the project. But if you don't look really close you might mess something. Or the example you're watching/reading doesn't have what you would miss.

It's not the name of your project. It's the name of your assembly.

BOOM! Mic dropped!

I'm back. I picked the mic back up.

If you have specific names for your assemblies for whatever reason, that's what the conventionis. And while for most people this could be the name of the project, because that's teh convention, it's good to know that it's not technically the correct answer. Semantics, pedantics.

<img src="/content/{assembly name}/{path from root}" />