Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 3483a32

Browse files
author
Nate McMaster
committed
automated: merge branch release/2.2
2 parents 7826b5b + 2e0e323 commit 3483a32

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

Directory.Build.props

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
1515
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build\Key.snk</AssemblyOriginatorKeyFile>
1616
<SignAssembly>true</SignAssembly>
17-
<AssemblySigningCertName>Microsoft</AssemblySigningCertName>
18-
<PackageSigningCertName>MicrosoftNuGet</PackageSigningCertName>
19-
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
2017
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2118
<!-- https://github.com/aspnet/BuildTools/issues/592 -->
2219
<EnableApiCheck>false</EnableApiCheck>

run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,27 +220,27 @@ if [ -f "$config_file" ]; then
220220
config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
221221
config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
222222
else
223-
_error "$config_file contains invalid JSON."
223+
__error "$config_file contains invalid JSON."
224224
exit 1
225225
fi
226226
elif __machine_has python ; then
227227
if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then
228228
config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
229229
config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
230230
else
231-
_error "$config_file contains invalid JSON."
231+
__error "$config_file contains invalid JSON."
232232
exit 1
233233
fi
234234
elif __machine_has python3 ; then
235235
if python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then
236236
config_channel="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
237237
config_tools_source="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
238238
else
239-
_error "$config_file contains invalid JSON."
239+
__error "$config_file contains invalid JSON."
240240
exit 1
241241
fi
242242
else
243-
_error 'Missing required command: jq or python. Could not parse the JSON file.'
243+
__error 'Missing required command: jq or python. Could not parse the JSON file.'
244244
exit 1
245245
fi
246246

src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,6 @@ public IWebHost Build()
162162
}
163163
}
164164

165-
var logger = hostingServiceProvider.GetRequiredService<ILogger<WebHost>>();
166-
// Warn about duplicate HostingStartupAssemblies
167-
foreach (var assemblyName in _options.GetFinalHostingStartupAssemblies().GroupBy(a => a, StringComparer.OrdinalIgnoreCase).Where(g => g.Count() > 1))
168-
{
169-
logger.LogWarning($"The assembly {assemblyName} was specified multiple times. Hosting startup assemblies should only be specified once.");
170-
}
171-
172165
AddApplicationServices(applicationServices, hostingServiceProvider);
173166

174167
var host = new WebHost(
@@ -181,6 +174,14 @@ public IWebHost Build()
181174
{
182175
host.Initialize();
183176

177+
var logger = host.Services.GetRequiredService<ILogger<WebHost>>();
178+
179+
// Warn about duplicate HostingStartupAssemblies
180+
foreach (var assemblyName in _options.GetFinalHostingStartupAssemblies().GroupBy(a => a, StringComparer.OrdinalIgnoreCase).Where(g => g.Count() > 1))
181+
{
182+
logger.LogWarning($"The assembly {assemblyName} was specified multiple times. Hosting startup assemblies should only be specified once.");
183+
}
184+
184185
return host;
185186
}
186187
catch
@@ -196,7 +197,7 @@ IServiceProvider GetProviderFromFactory(IServiceCollection collection)
196197
var provider = collection.BuildServiceProvider();
197198
var factory = provider.GetService<IServiceProviderFactory<IServiceCollection>>();
198199

199-
if (factory != null)
200+
if (factory != null && !(factory is DefaultServiceProviderFactory))
200201
{
201202
using (provider)
202203
{

0 commit comments

Comments
 (0)