Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.well-known folder missed from build #616

Open
adamzest opened this issue Jan 24, 2025 · 5 comments
Open

.well-known folder missed from build #616

adamzest opened this issue Jan 24, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@adamzest
Copy link

adamzest commented Jan 24, 2025

We have a project with a structure like

\wwwroot
   \scripts
      ....
   \.well-known
       \apple-app-site-association
       \assetlinks.json

Running a standard dotnet publish copies the folder structure to the output folder.

Running dotnet publish /t:PublishContainer produces an image with the wwwroot\scripts structure but without the .well-known folder. I can find no way to overcome this.

I've had to rename the folder to 'well-known' (with the dot prefix) and use url rewriting to rewrite requests for .well-known to well-known

@baronfel
Copy link
Member

baronfel commented Jan 24, 2025

@adamzest do you know what version of the .NET SDK or Container NuGet package you're using that you see this behavior in? I ask because we should have fixed this in dotnet/sdk#40624 back in May for .NET SDK 8.0.400 and onwards.

@adamzest
Copy link
Author

The project is net8.0 and in my repro'ing of this today I am using SDK 8.0.405

@baronfel
Copy link
Member

Thanks for the confirmation - we'll dig in.

@baronfel baronfel added the bug Something isn't working label Jan 24, 2025
@baronfel
Copy link
Member

baronfel commented Feb 2, 2025

I'm not able to reproduce this on 8.0.405. I've made a dotnet new web application, added static files, added a wwwroot/.well-known/app.txt file and verified that during a local publish it ends up in the publish directory, and then I docker exec'd into the generated containers for both the 404 and 405 version of the app and both contain this file. Can you verify that the .well-known file ends up in your publish directory when you publish locally?

@adamzest
Copy link
Author

adamzest commented Feb 3, 2025

Hi @baronfel

Thanks for looking. I just wrote out a really long response showing how I could still repro, and then I realised I'm an idiot. Of course in the linux container we are publishing, the .well-known folder is treated as hidden. ls -a and I can see it. So I would guess my problem all along was the file is present but hidden after publish, but AspNetCore isnt serving the static file because its hidden. Duh.

Sorry and thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants