Skip to content

[automated] Merge branch 'release/3.0-preview3' => 'master' #7790

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ jobs:
displayName: Run sign check
condition: eq(variables['_SignType'], 'real')

# Detect OSS Components in use in the product. Only needs to run on one OS in the matrix.
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: Detect components
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
artifacts:
- name: Windows_Packages
path: artifacts/packages/
Expand Down
17 changes: 11 additions & 6 deletions .azure/pipelines/jobs/default-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,26 @@ jobs:
- ${{ if eq(parameters.agentOs, 'Windows') }}:
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
displayName: Run build.cmd
- powershell: eng\scripts\KillProcesses.ps1
displayName: Kill processes
condition: always()
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: ./$(BuildDirectory)/build.sh -ci -p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
displayName: Run build.sh
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
condition: always()
- ${{ if ne(parameters.buildScript, '') }}:
- script: $(BuildScript) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
displayName: run $(BuildScript)

- ${{ parameters.afterBuild }}

- ${{ if eq(parameters.agentOs, 'Windows') }}:
- powershell: eng\scripts\KillProcesses.ps1
displayName: Kill processes
continueOnError: true
condition: always()
- ${{ if ne(parameters.agentOs, 'Windows') }}:
- script: eng/scripts/KillProcesses.sh
displayName: Kill processes
continueOnError: true
condition: always()

- task: PublishTestResults@2
displayName: Publish test results
condition: always()
Expand Down
32 changes: 21 additions & 11 deletions eng/scripts/KillProcesses.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
$ErrorActionPreference = 'Continue'

taskkill /T /F /IM dotnet.exe
taskkill /T /F /IM testhost.exe
taskkill /T /F /IM iisexpress.exe
taskkill /T /F /IM iisexpresstray.exe
taskkill /T /F /IM w3wp.exe
taskkill /T /F /IM msbuild.exe
taskkill /T /F /IM vbcscompiler.exe
taskkill /T /F /IM git.exe
taskkill /T /F /IM vctip.exe
taskkill /T /F /IM chrome.exe
taskkill /T /F /IM h2spec.exe
function _kill($processName) {
try {
# Redirect stderr to stdout to avoid big red blocks of output in Azure Pipeline logging
# when there are no instances of the process
& cmd /c "taskkill /T /F /IM ${processName} 2>&1"
} catch {
Write-Host "Failed to kill ${processName}: $_"
}
}

_kill dotnet.exe
_kill testhost.exe
_kill iisexpress.exe
_kill iisexpresstray.exe
_kill w3wp.exe
_kill msbuild.exe
_kill vbcscompiler.exe
_kill git.exe
_kill vctip.exe
_kill chrome.exe
_kill h2spec.exe
iisreset /restart

exit 0
33 changes: 8 additions & 25 deletions src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<PackageTags>aspnetcore;targeting-pack</PackageTags>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>

<!-- Subject to change: see https://github.com/dotnet/designs/pull/50 -->
<PackageType>TargetingPack</PackageType>
<PackageType>DotnetPlatform</PackageType>
<RefAssemblyPackagePath>ref/$(TargetFramework)/</RefAssemblyPackagePath>

<LayoutTargetDir>$(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/$(RefAssemblyPackagePath)</LayoutTargetDir>
<LayoutTargetDir>$(TargetingPackLayoutRoot)packs/Microsoft.AspNetCore.App.Ref/$(PackageVersion)/</LayoutTargetDir>
<ArchiveOutputFileName>aspnetcore-targeting-pack-$(PackageVersion).zip</ArchiveOutputFileName>
<ArchiveOutputPath>$(InstallersOutputPath)$(ArchiveOutputFileName)</ArchiveOutputPath>

Expand Down Expand Up @@ -56,7 +55,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
$(BuildDependsOn);
GeneratePackageConflictManifest;
_ResolveTargetingPackContent;
_BatchCopyToOutputDirectory;
_BatchCopyToLayoutTargetDir;
_CreateTargetingPackArchive;
</BuildDependsOn>
Expand Down Expand Up @@ -87,15 +85,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant

<AspNetCoreReferenceDocXml Include="@(AspNetCoreReferenceAssemblyPath->'%(RootDir)%(Directory)%(FileName).xml')" />

<!-- Exclude known missing XML docs files. Time-boxing this workaround because we want XML docs for everything. This can be removed when we get a new build with https://github.com/dotnet/core-setup/pull/5109. -->
<AspNetCoreReferenceDocXml Remove="@(AspNetCoreReferenceDocXml)"
Condition="'$(MicrosoftNETCoreAppPackageVersion)' == '3.0.0-preview-27405-2' AND ('%(FileName)' == 'Microsoft.Extensions.DependencyModel' OR '%(FileName)' == 'Microsoft.DotNet.PlatformAbstractions' )" />
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />

<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" />
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" />

<_PackageFiles Include="@(RefPackContent)" PackagePath="$(RefAssemblyPackagePath)" />
<_PackageFiles Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
<_PackageFiles Include="@(RefPackContent)" />
</ItemGroup>
</Target>

Expand All @@ -114,25 +108,14 @@ This package is an internal implementation of the .NET Core SDK and is not meant
Overwrite="true" />
</Target>

<!-- Written to take advantage of target batching in MSBuild. -->
<Target Name="_BatchCopyToOutputDirectory"
DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(TargetDir)%(FileName)%(Extension)')">

<Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(TargetDir)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
</Target>

<!-- Written to take advantage of target batching in MSBuild. -->
<Target Name="_BatchCopyToLayoutTargetDir"
DependsOnTargets="_ResolveTargetingPackContent"
Inputs="@(RefPackContent)"
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(FileName)%(Extension)')">
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">

<Copy SourceFiles="@(RefPackContent)"
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(FileName)%(Extension)')"
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
UseHardlinksIfPossible="true" />
</Target>

Expand Down
3 changes: 1 addition & 2 deletions src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
<PackageTags>aspnetcore;shared-framework</PackageTags>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>

<!-- Subject to change: see https://github.com/dotnet/designs/pull/50 -->
<PackageType>RuntimePack</PackageType>
<PackageType>DotnetPlatform</PackageType>
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
<!-- Target framework is not append to this because native assets to not have a target framework. -->
Expand Down
4 changes: 2 additions & 2 deletions src/Framework/src/SharedFx.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ This targets file should only be imported by .shfxproj files.
GenerateSharedFxVersionsFile;
GenerateBuildDependencyFile;
PrepareForPublish;
GeneratePublishDependencyFile;
GenerateSharedFxMetadataFiles;
GenerateBuildRuntimeConfigurationFiles;
ComputeAndCopyFilesToPublishDirectory;
GeneratePublishDependencyFile;
GenerateSharedFxMetadataFiles;
CopySharedFxToOutput;
CollectSharedFxOutput;
PostBuildEvent;
Expand Down
4 changes: 4 additions & 0 deletions src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<_Parameter1>ManifestOutputDir</_Parameter1>
<_Parameter2>%(_ResolvedFrameworkReference.ManifestOutputDir)</_Parameter2>
</AssemblyAttribute>
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
<_Parameter1>RuntimeAssetsOutputPath</_Parameter1>
<_Parameter2>%(_ResolvedFrameworkReference.RuntimeAssetsOutputPath)</_Parameter2>
</AssemblyAttribute>
</ItemGroup>
</Target>

Expand Down
29 changes: 28 additions & 1 deletion src/Framework/test/SharedFxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,33 @@ public SharedFxTests(ITestOutputHelper output)
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
}

[Fact]
public void SharedFrameworkContainsExpectedFiles()
{
var actualAssemblies = Directory.GetFiles(TestData.GetTestDataValue("RuntimeAssetsOutputPath"), "*.dll")
.Select(Path.GetFileNameWithoutExtension)
.ToHashSet();
var expectedAssemblies = TestData.GetSharedFxDependencies()
.Split(';', StringSplitOptions.RemoveEmptyEntries)
.ToHashSet();

_output.WriteLine("==== actual assemblies ====");
_output.WriteLine(string.Join('\n', actualAssemblies.OrderBy(i => i)));
_output.WriteLine("==== expected assemblies ====");
_output.WriteLine(string.Join('\n', expectedAssemblies.OrderBy(i => i)));

var missing = expectedAssemblies.Except(actualAssemblies);
var unexpected = actualAssemblies.Except(expectedAssemblies);

_output.WriteLine("==== missing assemblies from the framework ====");
_output.WriteLine(string.Join('\n', missing));
_output.WriteLine("==== unexpected assemblies in the framework ====");
_output.WriteLine(string.Join('\n', unexpected));

Assert.Empty(missing);
Assert.Empty(unexpected);
}

[Fact]
public void PlatformManifestListsAllFiles()
{
Expand All @@ -35,7 +62,7 @@ public void PlatformManifestListsAllFiles()
_output.WriteLine("==== file contents ====");
_output.WriteLine(File.ReadAllText(platformManifestPath));
_output.WriteLine("==== expected assemblies ====");
_output.WriteLine(string.Join('\n', expectedAssemblies));
_output.WriteLine(string.Join('\n', expectedAssemblies.OrderBy(i => i)));

AssertEx.FileExists(platformManifestPath);

Expand Down
3 changes: 1 addition & 2 deletions src/Middleware/CORS/samples/SampleDestination/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ public void ConfigureServices(IServiceCollection services)
options.AddPolicy("AllowAll", policy => policy
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
.AllowAnyHeader());
});
services.AddRouting();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public void Configure(IApplicationBuilder app)
innerBuilder.UseCors(policy => policy
.AllowAnyOrigin()
.AllowAnyMethod()
.AllowAnyHeader()
.AllowCredentials());
.AllowAnyHeader());

innerBuilder.UseMiddleware<SampleMiddleware>();
});
Expand Down
5 changes: 5 additions & 0 deletions src/Middleware/CORS/src/Infrastructure/CorsPolicyBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ public CorsPolicyBuilder SetIsOriginAllowedToAllowWildcardSubdomains()
/// <returns>The constructed <see cref="CorsPolicy"/>.</returns>
public CorsPolicy Build()
{
if (_policy.AllowAnyOrigin && _policy.SupportsCredentials)
{
throw new InvalidOperationException(Resources.InsecureConfiguration);
}

return _policy;
}

Expand Down
3 changes: 1 addition & 2 deletions src/Middleware/CORS/src/Infrastructure/CorsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using Microsoft.AspNetCore.Cors.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;

Expand Down Expand Up @@ -77,7 +76,7 @@ public CorsResult EvaluatePolicy(HttpContext context, CorsPolicy policy)

if (policy.AllowAnyOrigin && policy.SupportsCredentials)
{
_logger.InsecureConfiguration();
throw new ArgumentException(Resources.InsecureConfiguration, nameof(policy));
}

var origin = context.Request.Headers[CorsConstants.Origin];
Expand Down
11 changes: 0 additions & 11 deletions src/Middleware/CORS/src/Internal/CORSLoggerExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ internal static class CORSLoggerExtensions
private static readonly Action<ILogger, string, Exception> _requestHeaderNotAllowed;
private static readonly Action<ILogger, Exception> _failedToSetCorsHeaders;
private static readonly Action<ILogger, Exception> _noCorsPolicyFound;
private static readonly Action<ILogger, Exception> _insecureConfiguration;
private static readonly Action<ILogger, Exception> _isNotPreflightRequest;

static CORSLoggerExtensions()
Expand Down Expand Up @@ -73,11 +72,6 @@ static CORSLoggerExtensions()
new EventId(10, "NoCorsPolicyFound"),
"No CORS policy found for the specified request.");

_insecureConfiguration = LoggerMessage.Define(
LogLevel.Warning,
new EventId(11, "InsecureConfiguration"),
"The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time. Configure the policy by listing individual origins if credentials needs to be supported.");

_isNotPreflightRequest = LoggerMessage.Define(
LogLevel.Debug,
new EventId(12, "IsNotPreflightRequest"),
Expand Down Expand Up @@ -134,11 +128,6 @@ public static void NoCorsPolicyFound(this ILogger logger)
_noCorsPolicyFound(logger, null);
}

public static void InsecureConfiguration(this ILogger logger)
{
_insecureConfiguration(logger, null);
}

public static void IsNotPreflightRequest(this ILogger logger)
{
_isNotPreflightRequest(logger, null);
Expand Down
58 changes: 58 additions & 0 deletions src/Middleware/CORS/src/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading