dotnet / dotnet/aspnetcore

Provide an API to configure the TempDirectory used by ASP.NET Core

Open
#9,466 13 comments 3 reactions 0 assignees View on GitHub
affected-very-few area-networking breaking-change enhancement feature-http-abstractions severity-nice-to-have
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 10h
Merged PRs (30d)
281

Description

ASP.NET Core currently uses an environment variable to drive the temp directory, falling back `Path.GetTempPath()`. See https://github.com/aspnet/AspNetCore/blob/56e2080ef7741dea9a5c24a8e0639b0921be2d22/src/Http/Http/src/Internal/BufferingHelper.cs#L18-L39.

This path is currently in use by `FileBufferingReadStream` and as of https://github.com/aspnet/AspNetCore/pull/9015 change, by `FileBufferingWriteStream`.

This is one of the few parts of the stack that is only configurable via environment variable. We should instead follow the regular pattern of having an option type (that can be configured via configuration) and use those in when constructing these streams and everywhere else ASP.NET Core may need to write to the temp directory.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.