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

Replace IHostingEnvironment with IWebHostEnvironment #7725

Merged
merged 2 commits into from Feb 20, 2019

Conversation

@Tratcher
Copy link
Member

commented Feb 19, 2019

This is the second half of aspnet/Extensions#966

IHostingEnvironment is replaced by IWebHostEnvironment
IApplicationEnvironment is replaced by Extensions.Hosting.IHostApplicationEnvironment

Due to the size and timing of this PR nits in samples or tests are unlikely to be addressed.

Also, there are quite a few public constructors that were modified. These are primarily invoked by DI and there is little end-user impact. I'm not keeping the old constructors as the old types are not convertible to the new types. Removing the old constructors seems preferable to obsoleting them with an error.

@Tratcher Tratcher added this to the 3.0.0-preview3 milestone Feb 19, 2019
@Tratcher Tratcher self-assigned this Feb 19, 2019
@Tratcher Tratcher requested review from davidfowl, glennc and JunTaoLuo Feb 19, 2019
@Tratcher Tratcher requested a review from BrennanConroy Feb 19, 2019
@JunTaoLuo

This comment has been minimized.

Copy link
Contributor

commented Feb 19, 2019

:shipit: When tests pass.

@@ -9,7 +9,62 @@ namespace Microsoft.AspNetCore.Hosting.Internal
{
public static class HostingEnvironmentExtensions
{
#pragma warning disable CS0618 // Type or member is obsolete

This comment has been minimized.

Copy link
@davidfowl

davidfowl Feb 20, 2019

Member

I dunno why this was made public in the first place.

@Tratcher Tratcher merged commit 4e44025 into master Feb 20, 2019
17 of 18 checks passed
17 of 18 checks passed
AspNetCore-helix-test Build #20190219.50 has failed
Details
AspNetCore-ci Build #20190219.54 has test failures
Details
AspNetCore-ci (Build: Linux ARM) Build: Linux ARM succeeded
Details
AspNetCore-ci (Build: Linux ARM64) Build: Linux ARM64 succeeded
Details
AspNetCore-ci (Build: Linux Musl x64) Build: Linux Musl x64 succeeded
Details
AspNetCore-ci (Build: Linux x64) Build: Linux x64 succeeded
Details
AspNetCore-ci (Build: Windows ARM) Build: Windows ARM succeeded
Details
AspNetCore-ci (Build: Windows x64/x86) Build: Windows x64/x86 succeeded
Details
AspNetCore-ci (Build: macOS) Build: macOS succeeded
Details
AspNetCore-ci (Code check) Code check succeeded
Details
AspNetCore-ci (Test: ANCM IIS) Test: ANCM IIS succeeded
Details
AspNetCore-ci (Test: ANCM IISBackCompat) Test: ANCM IISBackCompat succeeded
Details
AspNetCore-ci (Test: ANCM IISExpress) Test: ANCM IISExpress succeeded
Details
AspNetCore-ci (Test: ANCM IISForwardCompat) Test: ANCM IISForwardCompat succeeded
Details
AspNetCore-ci (Test: Ubuntu 16.04 x64) Test: Ubuntu 16.04 x64 succeeded
Details
AspNetCore-ci (Test: Windows Server 2016 x64) Test: Windows Server 2016 x64 succeeded
Details
AspNetCore-ci (Test: macOS 10.13) Test: macOS 10.13 succeeded
Details
license/cla All CLA requirements met.
Details
@Tratcher Tratcher deleted the tratcher/hosting branch Feb 20, 2019
@tebeco

This comment has been minimized.

Copy link
Contributor

commented Feb 20, 2019

dumb question but why not align interface name ?
IXxxHostEnvironment or IHostYyyEnvironment

when people are going to find IHostApplicationEnvironment it will probably NOT be straightforward to think that you actually have to backspace back to I to re-type Web

that’s a really naive question there are probably tons of better reason than doing
IWebHostEnvironment
IApplicationHostEnvironment

or
IHostWebEnvironnent
IHostApplicationEnvironment

@Tratcher

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2019

The new types are:
IHostEnvironment
IWebHostEnvironment
IHostApplicationLifetime

IHostWebEnvironment doesn't convey any more meaning.

IApplicationHostLifetime sounds slightly better than IHostApplicationLifetime. @davidfowl @glennc?

@Tratcher

This comment has been minimized.

Copy link
Member Author

commented Feb 20, 2019

Announcement posted. #7749

@dustinsoftware dustinsoftware referenced this pull request Apr 29, 2019
4 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.