Err 404 on css and images in wwwroot

Boucourt 105 Points de réputation
2025-05-16T21:38:59.2033333+00:00

Hello,

I converted my Asp.Net application from .NET 8 to .NET 9.

After converting, I'm getting 404 errors.

My images and parts of my CSS aren't loading.

Home Page .NET8

Local version display Home page

With .NET9

Staging version after publish

Console show

Console output

I know the cause of the last error. I don't know how to fix the first three.

Here's the HTML for the image in the top right corner:

<figure class="my-0 float-end">

<img height="114px" width="190px" src="/logo/Logo___Pal_w_trans.png">

	<figcaption text-center="">

	</figcaption>

</figure>

here is the .cshtml

<figure class="my-0 float-end">
	<img height="114px" width="190px"
		  src="~/logo/Logo___Pal_w_trans.png" />
	<figcaption text-center>
		@if (@User.Identity?.Name != null)
		{
			<span p-0> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@User.Identity?.Name </span>
		}
	</figcaption>
</figure>
Technologies de développement | ASP.NET | Autres
{count} votes

Votre réponse

Les réponses peuvent être marquées comme « Acceptées » par l’auteur de la question et « Recommandées » par les modérateurs, ce qui aide les utilisateurs à savoir que la réponse a résolu le problème de l’auteur.