Static File Casing Changed or Missing in .NET 8 Deployment
joerdie
FREEOP

a year ago

I’m deploying a .NET 8 app with static files served from wwwroot/images/MainLayoutImages. My .csproj explicitly includes all content using:

<Content Include="wwwroot\**\*.*" CopyToPublishDirectory="PreserveNewest" />

When I inspect the output of dotnet publish, the folder and filenames are exactly correct and match the casing used in my HTML views — for example:

wwwroot/images/MainLayoutImages/01JoerdieHeadshot.jpg

However, in production, requests to:

https://<myapp>.railway.app/images/MainLayoutImages/01JoerdieHeadshot.jpg

return a 404.

If I manually change the image casing in the browser to match a different pattern, the image may resolve — which suggests the deployed casing is being altered or excluded.

I've confirmed:

  • No casing mismatch in source or publish output
  • No exclusion rules in .csproj
  • Publish folder on local matches what I expect
  • Logs confirm 404s at deployment, not runtime errors

Can you confirm whether Railway:

  1. Alters static file casing during publish/build?
  2. Applies any special handling to /wwwroot folders?

Thanks — I’ve spent multiple days tracing this and can provide my repo or deploy link if needed.

$10 Bounty

2 Replies

sim
FREE

a year ago

I do not know what Railway does but if you update the casing for folders like this wwwroot/images/MainLayoutImages/ to kebab-case?


sim
FREE

a year ago

If no progress, share the repo etc and I will look closer


Welcome!

Sign in to your Railway account to join the conversation.

Loading...