Merge branch 'rel/2.0.0-preview1' into dev
This commit is contained in:
commit
b19dd5c4da
|
|
@ -3,6 +3,7 @@
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
|
<add key="AspNetCore" value="https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json" />
|
||||||
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
|
<add key="AspNetCoreTools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
|
||||||
|
<add key="msbuild" value="https://dotnet.myget.org/F/msbuild/api/v3/index.json" />
|
||||||
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,11 @@
|
||||||
<SignAssembly>true</SignAssembly>
|
<SignAssembly>true</SignAssembly>
|
||||||
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
|
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
|
||||||
<OriginalVersionSuffix>$(VersionSuffix)</OriginalVersionSuffix>
|
<OriginalVersionSuffix>$(VersionSuffix)</OriginalVersionSuffix>
|
||||||
|
<VersionSuffix Condition="'$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
|
||||||
<!-- Don't mess with VersionSuffix, we need to use it unmodified in other targets -->
|
|
||||||
<BuildVersionSuffix>$(VersionSuffix)</BuildVersionSuffix>
|
|
||||||
<BuildVersionSuffix Condition="'$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</BuildVersionSuffix>
|
|
||||||
|
|
||||||
<!-- Pin versions to work around CLI bug -->
|
<!-- Pin versions to work around CLI bug -->
|
||||||
<AspNetCoreVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">2.0.0-$(BuildVersionSuffix)</AspNetCoreVersion>
|
<AspNetCoreVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">2.0.0-$(VersionSuffix)</AspNetCoreVersion>
|
||||||
<AspNetCoreIdentityServiceVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">1.0.0-$(BuildVersionSuffix)</AspNetCoreIdentityServiceVersion>
|
<AspNetCoreIdentityServiceVersion Condition="'$(BUILD_PACKAGE_CACHE)' == 'true'">1.0.0-$(VersionSuffix)</AspNetCoreIdentityServiceVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -100,6 +100,8 @@
|
||||||
<Error Text="AspNetPackageVersion must be specified" Condition=" '$(AspNetPackageVersion)' == '' " />
|
<Error Text="AspNetPackageVersion must be specified" Condition=" '$(AspNetPackageVersion)' == '' " />
|
||||||
<Error Text="PackageSource must be specified" Condition=" '$(PackageSource)' == '' " />
|
<Error Text="PackageSource must be specified" Condition=" '$(PackageSource)' == '' " />
|
||||||
<Error Text="OutputPackageName must be specified" Condition=" '$(OutputPackageName)' == '' " />
|
<Error Text="OutputPackageName must be specified" Condition=" '$(OutputPackageName)' == '' " />
|
||||||
|
<Error Text="ArchiverPath must be specified" Condition=" '$(ArchiverPath)' == '' " />
|
||||||
|
<Error Text="Archiver not found at $(ArchiverPath)" Condition="!Exists('$(ArchiverPath)')" />
|
||||||
|
|
||||||
<!-- Clear the directories -->
|
<!-- Clear the directories -->
|
||||||
<RemoveDir Directories="$(FallbackArchiveDir)bin" />
|
<RemoveDir Directories="$(FallbackArchiveDir)bin" />
|
||||||
|
|
@ -125,9 +127,8 @@
|
||||||
<MSBuild Projects="$(FallbackArchiveProj)" Targets="Restore" Properties="RestorePackagesPath=$(FallbackStagingDir);AspNetPackageVersion=$(AspNetPackageVersion);RestoreConfigFile=$(FallbackRestoreConfigFile)" />
|
<MSBuild Projects="$(FallbackArchiveProj)" Targets="Restore" Properties="RestorePackagesPath=$(FallbackStagingDir);AspNetPackageVersion=$(AspNetPackageVersion);RestoreConfigFile=$(FallbackRestoreConfigFile)" />
|
||||||
|
|
||||||
<!-- Create the archive -->
|
<!-- Create the archive -->
|
||||||
<Error Text="Archiver failed to build? Could not find it at $(ArchiverBinary)" Condition="!Exists('$(ArchiverBinary)')" />
|
|
||||||
<Message Text="Producing LZMA Archive, this may take a while..." Importance="high" />
|
<Message Text="Producing LZMA Archive, this may take a while..." Importance="high" />
|
||||||
<Exec Command="dotnet $(ArchiverBinary) -a $(FallbackOutputArchive) $(FallbackStagingDir)" />
|
<Exec Command="$(ArchiverPath) -a $(FallbackOutputArchive) $(FallbackStagingDir)" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="BuildFallbackArchive">
|
<Target Name="BuildFallbackArchive">
|
||||||
|
|
@ -141,8 +142,8 @@
|
||||||
<NoTimestampSuffix Condition="'$(TIMESTAMP_FREE_VERSION)' != ''">$(TIMESTAMP_FREE_VERSION)</NoTimestampSuffix>
|
<NoTimestampSuffix Condition="'$(TIMESTAMP_FREE_VERSION)' != ''">$(TIMESTAMP_FREE_VERSION)</NoTimestampSuffix>
|
||||||
<NoTimestampSuffix Condition="'$(NoTimestampSuffix)' == ''">final</NoTimestampSuffix>
|
<NoTimestampSuffix Condition="'$(NoTimestampSuffix)' == ''">final</NoTimestampSuffix>
|
||||||
|
|
||||||
<NoTimestampVersion>$(VersionPrefix)-$(VersionSuffix)-$(NoTimestampSuffix)</NoTimestampVersion>
|
<NoTimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(NoTimestampSuffix)</NoTimestampVersion>
|
||||||
<TimestampVersion>$(VersionPrefix)-$(VersionSuffix)-$(BuildNumber)</TimestampVersion>
|
<TimestampVersion>$(VersionPrefix)-$(OriginalVersionSuffix)-$(BuildNumber)</TimestampVersion>
|
||||||
|
|
||||||
<NoTimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages-NoTimeStamp</NoTimestampSource>
|
<NoTimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages-NoTimeStamp</NoTimestampSource>
|
||||||
<TimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages</TimestampSource>
|
<TimestampSource>$(COHERENCE_SIGNED_DROP_LOCATION)\Signed\Packages</TimestampSource>
|
||||||
|
|
@ -155,14 +156,14 @@
|
||||||
<!-- Run the actual target twice, once for timestamped packages, once for non-timestamped packages -->
|
<!-- Run the actual target twice, once for timestamped packages, once for non-timestamped packages -->
|
||||||
<!-- Here, we're re-invoking KoreBuild, but limiting it to a specific target. -->
|
<!-- Here, we're re-invoking KoreBuild, but limiting it to a specific target. -->
|
||||||
<!-- This won't rerun the whole build, but it ensures that the necessary MSBuild Tasks and Properties are initialized -->
|
<!-- This won't rerun the whole build, but it ensures that the necessary MSBuild Tasks and Properties are initialized -->
|
||||||
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(TimestampVersion);PackageSource=$(TimestampSource);OutputPackageName=nuGetPackagesArchive.timestamped" />
|
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(TimestampVersion);PackageSource=$(TimestampSource);OutputPackageName=nuGetPackagesArchive.timestamped;ArchiverPath=$(ArchiverPath)" />
|
||||||
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(NoTimestampVersion);PackageSource=$(NoTimestampSource);OutputPackageName=nuGetPackagesArchive.notimestamp" />
|
<MSBuild Projects="$(ProjectPath)" Targets="_BuildFallbackArchive" Properties="AspNetPackageVersion=$(NoTimestampVersion);PackageSource=$(NoTimestampSource);OutputPackageName=nuGetPackagesArchive.notimestamp;ArchiverPath=$(ArchiverPath)" />
|
||||||
|
|
||||||
<!-- Copy LZMA archives to Coherence-Signed drop location -->
|
<!-- Copy LZMA archives to Coherence-Signed drop location -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PublishDir Condition="'$(PublishShare)' != ''">$(PublishShare)\fallbackArchives</PublishDir>
|
<PublishDir Condition="'$(PublishShare)' != ''">$(PublishShare)\fallbackArchives</PublishDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Copy SourceFiles="$(RepositoryRoot)artifacts\nuGetPackagesArchive.timestamped.lzma;$(RepositoryRoot)artifacts\nuGetPackagesArchive..notimestamp.lzma" DestinationFolder="$(PublishDir)" Condition="'$(PublishDir)' != ''" />
|
<Copy SourceFiles="$(RepositoryRoot)artifacts\nuGetPackagesArchive.timestamped.lzma;$(RepositoryRoot)artifacts\nuGetPackagesArchive.notimestamp.lzma" DestinationFolder="$(PublishDir)" Condition="'$(PublishDir)' != ''" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="AddManifestsToNupkg">
|
<Target Name="AddManifestsToNupkg">
|
||||||
|
|
|
||||||
|
|
@ -4,28 +4,22 @@
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
<PackageTargetFallback>$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;</PackageTargetFallback>
|
||||||
<EnableApiCheck>false</EnableApiCheck>
|
<EnableApiCheck>false</EnableApiCheck>
|
||||||
|
<DotnetCliToolTargetFramework>netcoreapp2.0</DotnetCliToolTargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Something simple to get it working right now -->
|
|
||||||
<PackageReference Include="Microsoft.Extensions.ObjectPool" Version="$(AspNetPackageVersion)" />
|
|
||||||
|
|
||||||
<!-- Our packages are broken right now :(
|
|
||||||
<PackageReference Include="Microsoft.AspNetCore.All" Version="$(AspNetPackageVersion)" />
|
<PackageReference Include="Microsoft.AspNetCore.All" Version="$(AspNetPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="$(AspNetPackageVersion)" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="$(AspNetPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="$(AspNetPackageVersion)" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite.Design" Version="$(AspNetPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="$(AspNetPackageVersion)" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer.Design" Version="$(AspNetPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(AspNetPackageVersion)" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="$(AspNetPackageVersion)" />
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(AspNetPackageVersion)" />
|
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="$(AspNetPackageVersion)" />
|
||||||
-->
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<!-- Tools don't work right now
|
|
||||||
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(AspNetPackageVersion)" />
|
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="$(AspNetPackageVersion)" />
|
||||||
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="$(AspNetPackageVersion)" />
|
<DotNetCliToolReference Include="Microsoft.Extensions.SecretManager.Tools" Version="$(AspNetPackageVersion)" />
|
||||||
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="$(AspNetPackageVersion)" />
|
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="$(AspNetPackageVersion)" />
|
||||||
-->
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -175,8 +175,9 @@ namespace Microsoft.AspNetCore
|
||||||
config.AddCommandLine(args);
|
config.AddCommandLine(args);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.ConfigureLogging(logging =>
|
.ConfigureLogging((hostingContext, logging) =>
|
||||||
{
|
{
|
||||||
|
logging.UseConfiguration(hostingContext.Configuration.GetSection("Logging"));
|
||||||
logging.AddConsole();
|
logging.AddConsole();
|
||||||
logging.AddDebug();
|
logging.AddDebug();
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<TargetFramework>netcoreapp2.0</TargetFramework>
|
<TargetFramework>netcoreapp2.0</TargetFramework>
|
||||||
<OutputType>Exe</OutputType>
|
<OutputType>Exe</OutputType>
|
||||||
<EnableApiCheck>false</EnableApiCheck>
|
<EnableApiCheck>false</EnableApiCheck>
|
||||||
|
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -200,6 +200,47 @@ namespace Microsoft.AspNetCore.Tests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void LoggingConfigurationSectionPassedToLoggerByDefault()
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
File.WriteAllText("appsettings.json", @"
|
||||||
|
{
|
||||||
|
""Logging"": {
|
||||||
|
""LogLevel"": {
|
||||||
|
""Default"": ""Warning""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
");
|
||||||
|
using (var webHost = WebHost.Start(context => context.Response.WriteAsync("Hello, World!")))
|
||||||
|
{
|
||||||
|
var factory = (ILoggerFactory)webHost.Services.GetService(typeof(ILoggerFactory));
|
||||||
|
var logger = factory.CreateLogger("Test");
|
||||||
|
|
||||||
|
logger.Log(LogLevel.Information, 0, "Message", null, (s, e) =>
|
||||||
|
{
|
||||||
|
Assert.True(false);
|
||||||
|
return string.Empty;
|
||||||
|
});
|
||||||
|
|
||||||
|
var logWritten = false;
|
||||||
|
logger.Log(LogLevel.Warning, 0, "Message", null, (s, e) =>
|
||||||
|
{
|
||||||
|
logWritten = true;
|
||||||
|
return string.Empty;
|
||||||
|
});
|
||||||
|
|
||||||
|
Assert.True(logWritten);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
File.Delete("appsettings.json");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task ExecuteStartOrStartWithTest(Func<DeploymentResult, Task<HttpResponseMessage>> getResponse, string applicationName)
|
private async Task ExecuteStartOrStartWithTest(Func<DeploymentResult, Task<HttpResponseMessage>> getResponse, string applicationName)
|
||||||
{
|
{
|
||||||
await ExecuteTestApp(applicationName, async (deploymentResult, logger) =>
|
await ExecuteTestApp(applicationName, async (deploymentResult, logger) =>
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,6 @@ namespace CreateDefaultBuilderApp
|
||||||
string responseMessage = string.Empty;
|
string responseMessage = string.Empty;
|
||||||
|
|
||||||
WebHost.CreateDefaultBuilder(new[] { "--cliKey", "cliValue" })
|
WebHost.CreateDefaultBuilder(new[] { "--cliKey", "cliValue" })
|
||||||
.UseLoggerFactory(new TestLoggerFactory())
|
|
||||||
.ConfigureServices((context, services) =>
|
.ConfigureServices((context, services) =>
|
||||||
{
|
{
|
||||||
responseMessage = GetResponseMessage(context, services);
|
responseMessage = GetResponseMessage(context, services);
|
||||||
|
|
@ -77,34 +76,11 @@ namespace CreateDefaultBuilderApp
|
||||||
return $"Command line arguments not loaded into Configuration.";
|
return $"Command line arguments not loaded into Configuration.";
|
||||||
}
|
}
|
||||||
|
|
||||||
var testLoggerFactory = (TestLoggerFactory)context.LoggerFactory;
|
// TODO: Verify AddConsole called
|
||||||
|
// TODO: Verify AddDebug called
|
||||||
// Verify AddConsole called
|
|
||||||
if (!testLoggerFactory.Providers.Any(provider => provider is ConsoleLoggerProvider))
|
|
||||||
{
|
|
||||||
return $"Console logger not added to ILoggerFactory.";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Verify AddDebug called
|
|
||||||
if (!testLoggerFactory.Providers.Any(provider => provider is DebugLoggerProvider))
|
|
||||||
{
|
|
||||||
return $"Debug logger not added to ILoggerFactory.";
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Verify UseIISIntegration called
|
// TODO: Verify UseIISIntegration called
|
||||||
|
|
||||||
return context.HostingEnvironment.ApplicationName;
|
return context.HostingEnvironment.ApplicationName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private class TestLoggerFactory : ILoggerFactory
|
|
||||||
{
|
|
||||||
public IList<ILoggerProvider> Providers { get; } = new List<ILoggerProvider>();
|
|
||||||
|
|
||||||
public void AddProvider(ILoggerProvider provider) => Providers.Add(provider);
|
|
||||||
|
|
||||||
public ILogger CreateLogger(string categoryName) => NullLogger.Instance;
|
|
||||||
|
|
||||||
public void Dispose() { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue