ASP.NET Core publish of wwwroot subfolders starting with '.'

736 Views Asked by At

I have an ASP.NET Core project where wwwroot folder subfolders that start with a letter get published fine but ones that start with . do not, e.g. wwwroot/.auth

Is there a known reason for that to be the case or does one need to do some special case step in csproj [ and dockerfile ] to include those subfolders starting with .?

1

There are 1 best solutions below

2
On BEST ANSWER

I had this problem too, I need to publish some static files in wwwroot/.well-known folder for LetsEncrypt validation

Just "include" the folder in the project, then press F4 on its files and in the "properties" set "copy to output folder"

Alternatively just copy-paste this into your .csproj

<ItemGroup>
  <Content Include="wwwroot\.well-known\*">
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  </Content>
</ItemGroup>