Skip to content

Commit 4451a80

Browse files
authored
Merge branch 'release/3.0-preview3'
2 parents e5f4400 + 7a87e8c commit 4451a80

File tree

22 files changed

+241
-228
lines changed

22 files changed

+241
-228
lines changed

.azure/pipelines/ci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ jobs:
7979
displayName: Run sign check
8080
condition: eq(variables['_SignType'], 'real')
8181

82-
# Detect OSS Components in use in the product. Only needs to run on one OS in the matrix.
83-
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
84-
displayName: Detect components
85-
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false))
8682
artifacts:
8783
- name: Windows_Packages
8884
path: artifacts/packages/

.azure/pipelines/jobs/default-build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,21 +140,26 @@ jobs:
140140
- ${{ if eq(parameters.agentOs, 'Windows') }}:
141141
- script: .\$(BuildDirectory)\build.cmd -ci /p:SignType=$(_SignType) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
142142
displayName: Run build.cmd
143-
- powershell: eng\scripts\KillProcesses.ps1
144-
displayName: Kill processes
145-
condition: always()
146143
- ${{ if ne(parameters.agentOs, 'Windows') }}:
147144
- script: ./$(BuildDirectory)/build.sh -ci -p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
148145
displayName: Run build.sh
149-
- script: eng/scripts/KillProcesses.sh
150-
displayName: Kill processes
151-
condition: always()
152146
- ${{ if ne(parameters.buildScript, '') }}:
153147
- script: $(BuildScript) /p:Configuration=$(BuildConfiguration) $(BuildScriptArgs)
154148
displayName: run $(BuildScript)
155149

156150
- ${{ parameters.afterBuild }}
157151

152+
- ${{ if eq(parameters.agentOs, 'Windows') }}:
153+
- powershell: eng\scripts\KillProcesses.ps1
154+
displayName: Kill processes
155+
continueOnError: true
156+
condition: always()
157+
- ${{ if ne(parameters.agentOs, 'Windows') }}:
158+
- script: eng/scripts/KillProcesses.sh
159+
displayName: Kill processes
160+
continueOnError: true
161+
condition: always()
162+
158163
- task: PublishTestResults@2
159164
displayName: Publish test results
160165
condition: always()

eng/scripts/KillProcesses.ps1

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
$ErrorActionPreference = 'Continue'
22

3-
taskkill /T /F /IM dotnet.exe
4-
taskkill /T /F /IM testhost.exe
5-
taskkill /T /F /IM iisexpress.exe
6-
taskkill /T /F /IM iisexpresstray.exe
7-
taskkill /T /F /IM w3wp.exe
8-
taskkill /T /F /IM msbuild.exe
9-
taskkill /T /F /IM vbcscompiler.exe
10-
taskkill /T /F /IM git.exe
11-
taskkill /T /F /IM vctip.exe
12-
taskkill /T /F /IM chrome.exe
13-
taskkill /T /F /IM h2spec.exe
3+
function _kill($processName) {
4+
try {
5+
# Redirect stderr to stdout to avoid big red blocks of output in Azure Pipeline logging
6+
# when there are no instances of the process
7+
& cmd /c "taskkill /T /F /IM ${processName} 2>&1"
8+
} catch {
9+
Write-Host "Failed to kill ${processName}: $_"
10+
}
11+
}
12+
13+
_kill dotnet.exe
14+
_kill testhost.exe
15+
_kill iisexpress.exe
16+
_kill iisexpresstray.exe
17+
_kill w3wp.exe
18+
_kill msbuild.exe
19+
_kill vbcscompiler.exe
20+
_kill git.exe
21+
_kill vctip.exe
22+
_kill chrome.exe
23+
_kill h2spec.exe
1424
iisreset /restart
1525

1626
exit 0

src/Framework/ref/Microsoft.AspNetCore.App.Ref.csproj

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ This package is an internal implementation of the .NET Core SDK and is not meant
1818
<PackageTags>aspnetcore;targeting-pack</PackageTags>
1919
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
2020

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

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

@@ -56,7 +55,6 @@ This package is an internal implementation of the .NET Core SDK and is not meant
5655
$(BuildDependsOn);
5756
GeneratePackageConflictManifest;
5857
_ResolveTargetingPackContent;
59-
_BatchCopyToOutputDirectory;
6058
_BatchCopyToLayoutTargetDir;
6159
_CreateTargetingPackArchive;
6260
</BuildDependsOn>
@@ -87,15 +85,11 @@ This package is an internal implementation of the .NET Core SDK and is not meant
8785

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

90-
<!-- 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. -->
91-
<AspNetCoreReferenceDocXml Remove="@(AspNetCoreReferenceDocXml)"
92-
Condition="'$(MicrosoftNETCoreAppPackageVersion)' == '3.0.0-preview-27405-2' AND ('%(FileName)' == 'Microsoft.Extensions.DependencyModel' OR '%(FileName)' == 'Microsoft.DotNet.PlatformAbstractions' )" />
88+
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" PackagePath="$(RefAssemblyPackagePath)" />
89+
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" PackagePath="$(RefAssemblyPackagePath)" />
90+
<RefPackContent Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
9391

94-
<RefPackContent Include="@(AspNetCoreReferenceAssemblyPath)" />
95-
<RefPackContent Include="@(AspNetCoreReferenceDocXml)" />
96-
97-
<_PackageFiles Include="@(RefPackContent)" PackagePath="$(RefAssemblyPackagePath)" />
98-
<_PackageFiles Include="$(TargetDir)$(PackageConflictManifestFileName)" PackagePath="$(PackageConflictManifestPackagePath)" />
92+
<_PackageFiles Include="@(RefPackContent)" />
9993
</ItemGroup>
10094
</Target>
10195

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

117-
<!-- Written to take advantage of target batching in MSBuild. -->
118-
<Target Name="_BatchCopyToOutputDirectory"
119-
DependsOnTargets="_ResolveTargetingPackContent"
120-
Inputs="@(RefPackContent)"
121-
Outputs="@(RefPackContent->'$(TargetDir)%(FileName)%(Extension)')">
122-
123-
<Copy SourceFiles="@(RefPackContent)"
124-
DestinationFiles="@(RefPackContent->'$(TargetDir)%(FileName)%(Extension)')"
125-
UseHardlinksIfPossible="true" />
126-
</Target>
127-
128111
<!-- Written to take advantage of target batching in MSBuild. -->
129112
<Target Name="_BatchCopyToLayoutTargetDir"
130113
DependsOnTargets="_ResolveTargetingPackContent"
131114
Inputs="@(RefPackContent)"
132-
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(FileName)%(Extension)')">
115+
Outputs="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')">
133116

134117
<Copy SourceFiles="@(RefPackContent)"
135-
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(FileName)%(Extension)')"
118+
DestinationFiles="@(RefPackContent->'$(LayoutTargetDir)%(PackagePath)%(FileName)%(Extension)')"
136119
UseHardlinksIfPossible="true" />
137120
</Target>
138121

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
2323
<PackageTags>aspnetcore;shared-framework</PackageTags>
2424
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
2525

26-
<!-- Subject to change: see https://github.com/dotnet/designs/pull/50 -->
27-
<PackageType>RuntimePack</PackageType>
26+
<PackageType>DotnetPlatform</PackageType>
2827
<!-- NuGet appends target framework to this value. Example: runtimes/win-x64/lib/netcoreapp3.0/ -->
2928
<BuildOutputTargetFolder>runtimes/$(RuntimeIdentifier)/lib/</BuildOutputTargetFolder>
3029
<!-- Target framework is not append to this because native assets to not have a target framework. -->

src/Framework/src/SharedFx.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ This targets file should only be imported by .shfxproj files.
1515
GenerateSharedFxVersionsFile;
1616
GenerateBuildDependencyFile;
1717
PrepareForPublish;
18-
GeneratePublishDependencyFile;
19-
GenerateSharedFxMetadataFiles;
2018
GenerateBuildRuntimeConfigurationFiles;
2119
ComputeAndCopyFilesToPublishDirectory;
20+
GeneratePublishDependencyFile;
21+
GenerateSharedFxMetadataFiles;
2222
CopySharedFxToOutput;
2323
CollectSharedFxOutput;
2424
PostBuildEvent;

src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
<_Parameter1>ManifestOutputDir</_Parameter1>
5050
<_Parameter2>%(_ResolvedFrameworkReference.ManifestOutputDir)</_Parameter2>
5151
</AssemblyAttribute>
52+
<AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
53+
<_Parameter1>RuntimeAssetsOutputPath</_Parameter1>
54+
<_Parameter2>%(_ResolvedFrameworkReference.RuntimeAssetsOutputPath)</_Parameter2>
55+
</AssemblyAttribute>
5256
</ItemGroup>
5357
</Target>
5458

src/Framework/test/SharedFxTests.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,33 @@ public SharedFxTests(ITestOutputHelper output)
2424
_expectedRid = TestData.GetSharedFxRuntimeIdentifier();
2525
}
2626

27+
[Fact]
28+
public void SharedFrameworkContainsExpectedFiles()
29+
{
30+
var actualAssemblies = Directory.GetFiles(TestData.GetTestDataValue("RuntimeAssetsOutputPath"), "*.dll")
31+
.Select(Path.GetFileNameWithoutExtension)
32+
.ToHashSet();
33+
var expectedAssemblies = TestData.GetSharedFxDependencies()
34+
.Split(';', StringSplitOptions.RemoveEmptyEntries)
35+
.ToHashSet();
36+
37+
_output.WriteLine("==== actual assemblies ====");
38+
_output.WriteLine(string.Join('\n', actualAssemblies.OrderBy(i => i)));
39+
_output.WriteLine("==== expected assemblies ====");
40+
_output.WriteLine(string.Join('\n', expectedAssemblies.OrderBy(i => i)));
41+
42+
var missing = expectedAssemblies.Except(actualAssemblies);
43+
var unexpected = actualAssemblies.Except(expectedAssemblies);
44+
45+
_output.WriteLine("==== missing assemblies from the framework ====");
46+
_output.WriteLine(string.Join('\n', missing));
47+
_output.WriteLine("==== unexpected assemblies in the framework ====");
48+
_output.WriteLine(string.Join('\n', unexpected));
49+
50+
Assert.Empty(missing);
51+
Assert.Empty(unexpected);
52+
}
53+
2754
[Fact]
2855
public void PlatformManifestListsAllFiles()
2956
{
@@ -35,7 +62,7 @@ public void PlatformManifestListsAllFiles()
3562
_output.WriteLine("==== file contents ====");
3663
_output.WriteLine(File.ReadAllText(platformManifestPath));
3764
_output.WriteLine("==== expected assemblies ====");
38-
_output.WriteLine(string.Join('\n', expectedAssemblies));
65+
_output.WriteLine(string.Join('\n', expectedAssemblies.OrderBy(i => i)));
3966

4067
AssertEx.FileExists(platformManifestPath);
4168

src/Middleware/CORS/samples/SampleDestination/Startup.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ public void ConfigureServices(IServiceCollection services)
5050
options.AddPolicy("AllowAll", policy => policy
5151
.AllowAnyOrigin()
5252
.AllowAnyMethod()
53-
.AllowAnyHeader()
54-
.AllowCredentials());
53+
.AllowAnyHeader());
5554
});
5655
services.AddRouting();
5756
}

src/Middleware/CORS/samples/SampleDestination/StartupWithoutEndpointRouting.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ public void Configure(IApplicationBuilder app)
7373
innerBuilder.UseCors(policy => policy
7474
.AllowAnyOrigin()
7575
.AllowAnyMethod()
76-
.AllowAnyHeader()
77-
.AllowCredentials());
76+
.AllowAnyHeader());
7877

7978
innerBuilder.UseMiddleware<SampleMiddleware>();
8079
});

src/Middleware/CORS/src/Infrastructure/CorsPolicyBuilder.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,11 @@ public CorsPolicyBuilder SetIsOriginAllowedToAllowWildcardSubdomains()
224224
/// <returns>The constructed <see cref="CorsPolicy"/>.</returns>
225225
public CorsPolicy Build()
226226
{
227+
if (_policy.AllowAnyOrigin && _policy.SupportsCredentials)
228+
{
229+
throw new InvalidOperationException(Resources.InsecureConfiguration);
230+
}
231+
227232
return _policy;
228233
}
229234

src/Middleware/CORS/src/Infrastructure/CorsService.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using Microsoft.AspNetCore.Cors.Internal;
99
using Microsoft.AspNetCore.Http;
1010
using Microsoft.Extensions.Logging;
11-
using Microsoft.Extensions.Logging.Abstractions;
1211
using Microsoft.Extensions.Options;
1312
using Microsoft.Extensions.Primitives;
1413

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

7877
if (policy.AllowAnyOrigin && policy.SupportsCredentials)
7978
{
80-
_logger.InsecureConfiguration();
79+
throw new ArgumentException(Resources.InsecureConfiguration, nameof(policy));
8180
}
8281

8382
var origin = context.Request.Headers[CorsConstants.Origin];

src/Middleware/CORS/src/Internal/CORSLoggerExtensions.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ internal static class CORSLoggerExtensions
1818
private static readonly Action<ILogger, string, Exception> _requestHeaderNotAllowed;
1919
private static readonly Action<ILogger, Exception> _failedToSetCorsHeaders;
2020
private static readonly Action<ILogger, Exception> _noCorsPolicyFound;
21-
private static readonly Action<ILogger, Exception> _insecureConfiguration;
2221
private static readonly Action<ILogger, Exception> _isNotPreflightRequest;
2322

2423
static CORSLoggerExtensions()
@@ -73,11 +72,6 @@ static CORSLoggerExtensions()
7372
new EventId(10, "NoCorsPolicyFound"),
7473
"No CORS policy found for the specified request.");
7574

76-
_insecureConfiguration = LoggerMessage.Define(
77-
LogLevel.Warning,
78-
new EventId(11, "InsecureConfiguration"),
79-
"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.");
80-
8175
_isNotPreflightRequest = LoggerMessage.Define(
8276
LogLevel.Debug,
8377
new EventId(12, "IsNotPreflightRequest"),
@@ -134,11 +128,6 @@ public static void NoCorsPolicyFound(this ILogger logger)
134128
_noCorsPolicyFound(logger, null);
135129
}
136130

137-
public static void InsecureConfiguration(this ILogger logger)
138-
{
139-
_insecureConfiguration(logger, null);
140-
}
141-
142131
public static void IsNotPreflightRequest(this ILogger logger)
143132
{
144133
_isNotPreflightRequest(logger, null);

src/Middleware/CORS/src/Properties/Resources.Designer.cs

Lines changed: 58 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)