Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not override content root with default #79242

Merged
merged 3 commits into from
Dec 8, 2022
Merged

Do not override content root with default #79242

merged 3 commits into from
Dec 8, 2022

Conversation

halter73
Copy link
Member

@halter73 halter73 commented Dec 5, 2022

This fixes #78583 which is a regression between .NET 6 and .NET 7 where the impact is that ASPNETCORE_CONTENTROOT always gets ignored.

The issue was customer reported. There is a workaround of using the DOTNET_CONTENTROOT or even just CONTENTROOT environment variables instead, but the ASPNETCORE_ environment variable prefix is common. I plan to backport this for .NET 7 servicing.

This issue is caused by HostApplicationBuilder overriding the content root configuration passed in by ASP.NET Core's WebApplicationBuilder via HostApplicationBuilderSettings.Configuration with the CWD. This fix changes the HostApplicationBuilder to only configure the default content root to be CWD if it has not already been configured manually.

@ghost
Copy link

ghost commented Dec 5, 2022

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

Issue Details

This fixes #78583 which is a regression between .NET 6 and .NET 7 where the impact is that ASPNETCORE_CONTENTROOT always gets ignored.

The issue was customer reported. There is a workaround of using the DOTNET_CONTENTROOT or even just CONTENTROOT environment variables instead, but the ASPNETCORE_ environment variable prefix is common. I plan to backport this for .NET 7 servicing.

This issue is caused by HostApplicationBuilder overriding the content root configuration passed in by ASP.NET Core's WebApplicationBuilder via HostApplicationBuilderSettings.Configuration with the CWD. This fix changes the HostApplicationBuilder to only configure the default content root to be CWD if it has not already been configured manually.

Author: halter73
Assignees: -
Labels:

area-Extensions-Hosting

Milestone: -

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. Sorry for the delay in approving.

@halter73
Copy link
Member Author

halter73 commented Dec 8, 2022

/backport to release/7.0

@github-actions
Copy link
Contributor

github-actions bot commented Dec 8, 2022

Started backporting to release/7.0: https://github.com/dotnet/runtime/actions/runs/3650905524

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.

ASPNETCORE_CONTENTROOT being ignored in .NET 7
3 participants