我希望在我的根目录下有一个 .well-known
目录以进行 Let's Encrypt 更新。
我已经添加了一个路由到 .well-known
,如下所示:
app.UseStaticFiles(new StaticFileOptions
{
FileProvider = new PhysicalFileProvider(Path.Combine(Directory.GetCurrentDirectory(), @".well-known")),
RequestPath = new PathString("/.well-known"),
ServeUnknownFileTypes = true // serve extensionless file
});
我在我的wwwroot中添加了一个名为.well-known
的目录,但是当我发布时它从未被复制到输出中。
我尝试向其中添加文件,并编辑csproj:
<ItemGroup>
<Content Include="wwwroot\.well-known\" />
</ItemGroup>
每次我发布内容时,都需要手动创建目录。如何实现自动将其添加到wwwroot中?
。
作为第一个字符的文件夹。 - Guerrilla