Код: Выделить всё
app.UseWhen(ctx => ctx.Request.Path.StartsWithSegments("/res", StringComparison.OrdinalIgnoreCase), appBuilder =>
{
appBuilder.UseStaticFiles(new StaticFileOptions
{
FileProvider = new HostResFileProvider(appBuilder.ApplicationServices.GetRequiredService(), builder.Environment),
RequestPath = "/res"
});
});
Код: Выделить всё
app.UseWhen(ctx => ctx.Request.Path.StartsWithSegments("/res", StringComparison.OrdinalIgnoreCase), appBuilder =>
{
appBuilder.UseStaticFiles(new StaticFileOptions
{
FileProvider = new HostResFileProvider(ctx, builder.Environment),
RequestPath = "/res"
});
});
Подробнее здесь: https://stackoverflow.com/questions/790 ... -parameter
Мобильная версия