Skip to content

Add Host.CreateDefaultBuilder and some dependencies - #637

Merged
Tratcher merged 1 commit into
masterfrom
tratcher/createdefault
Dec 13, 2018
Merged

Tratcher merged 1 commit into
masterfrom
tratcher/createdefault

Conversation

@Tratcher

@Tratcher Tratcher commented Dec 12, 2018 •

Copy link
Copy Markdown
Member

#597 Host.CreateDefaultBuilder
#612 UseServiceProviderFactory overloads (breaking interface addition) 👍 👎 ?
aspnet/Hosting#1418 UseDefaultServiceProvider
Ensure ApplicationName has a default value.
Moved the Internal.Host tests to the internal folder due to name conflicts.

@Tratcher Tratcher added this to the 3.0.0-preview2 milestone Dec 12, 2018
@Tratcher Tratcher self-assigned this Dec 12, 2018
@JunTaoLuo

Copy link
Copy Markdown

tests failed

@Tratcher
Tratcher force-pushed the tratcher/createdefault branch from 5354bfe to 3e56357 Compare December 12, 2018 20:25
@Tratcher

Copy link
Copy Markdown
Member Author

Reverted the ApplicationName change, GetEntryAssembly doesn't work from command line tests (only VS).

@davidfowl

Copy link
Copy Markdown
Member

I think the breaking change is fine here as it will only break implementors. We made a similar change to the header collection in 2.0 adding content length.

If the bar is higher then we can add a new interface and do ilight up using an extension method.

@Tratcher

Copy link
Copy Markdown
Member Author

Yeah, I have no expectation this one will break any consumers.

{
var builder = new HostBuilder();

builder.UseContentRoot(Directory.GetCurrentDirectory());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need the check we have in the other logic for the env var override?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, Host builder doesn't include env var config by default. We add it afterwards and it overrides.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

OK just make sure the scrnaeio fixed is indeed fixed here as well.

_serviceProviderFactory = serviceProviderFactory ?? throw new ArgumentNullException(nameof(serviceProviderFactory));
}

public ServiceFactoryAdapter(Func<HostBuilderContext> contextResolver, Func<HostBuilderContext, IServiceProviderFactory<TContainerBuilder>> factoryResolver)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why a func for the HostBuilderContext? Why not just pass it directly?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Because HostBuilderContext isn't created until you call Build and this gets called first.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see.

@davidfowl davidfowl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can’t read the tests. Too much churn 😬

@Tratcher
Tratcher merged commit ea0df66 into master Dec 13, 2018
@Tratcher
Tratcher deleted the tratcher/createdefault branch December 13, 2018 20:13
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Feb 28, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Mar 2, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Mar 11, 2020
maryamariyan pushed a commit to maryamariyan/runtime that referenced this pull request Mar 27, 2020
@ghost ghost locked as resolved and limited conversation to collaborators May 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants