KEMBAR78
Use Environment.SystemDirectory to get system directory by jkotas · Pull Request #83564 · dotnet/runtime · GitHub
Skip to content

Conversation

jkotas
Copy link
Member

@jkotas jkotas commented Mar 17, 2023

Environment.SystemDirectory is a lot more efficient than Environment.GetFolderPath(System.Environment.SpecialFolder.System).

Contributes to dotnet/aspnetcore#47269

Environment.SystemDirectory is a lot more efficient than Environment.GetFolderPath(System.Environment.SpecialFolder.System).

Contributes to dotnet/aspnetcore#47269
@jkotas jkotas marked this pull request as ready for review March 17, 2023 01:20
@ghost ghost assigned jkotas Mar 17, 2023
@ghost
Copy link

ghost commented Mar 17, 2023

Tagging subscribers to this area: @dotnet/area-extensions-hosting
See info in area-owners.md if you want to be subscribed.

Issue Details

Environment.SystemDirectory is a lot more efficient than Environment.GetFolderPath(System.Environment.SpecialFolder.System).

Contributes to dotnet/aspnetcore#47269

Author: jkotas
Assignees: jkotas
Labels:

area-Extensions-Hosting

Milestone: -

@jkotas jkotas requested a review from eerhardt March 17, 2023 01:21
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have a code analysis rule that looks for things that should be replaced with members of Environment. Looks like another one to add.

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm. Thanks for taking care of this!

@eerhardt
Copy link
Member

We already have a code analysis rule that looks for things that should be replaced with members of Environment. Looks like another one to add.

I've opened #83591 for this.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants