Handle null configuration in HostingServices.Create

This commit is contained in:
David Fowler 2014-11-23 22:48:28 -08:00
parent bd5c07d66a
commit 075edc516c
1 changed files with 2 additions and 1 deletions

View File

@ -32,11 +32,12 @@ namespace Microsoft.AspNet.Hosting
public static IServiceCollection Create(IConfiguration configuration = null)
{
return Create(CallContextServiceLocator.Locator.ServiceProvider);
return Create(CallContextServiceLocator.Locator.ServiceProvider, configuration);
}
public static IServiceCollection Create(IServiceProvider fallbackServices, IConfiguration configuration = null)
{
configuration = configuration ?? new Configuration();
var services = Import(fallbackServices);
services.Add(GetDefaultServices(configuration));
services.AddSingleton<IServiceManifest>(sp => new HostingManifest(fallbackServices));