.NET Core 2.0 reached EOL last year. This removes multi-targeting our test projects and test assets to only use .NET Core 2.1 and .NET Framework 4.6.1.
This simplifies the way that we publish files to our network drop share.
Changes:
* Instead of explicitly listing every file that needs to publish, use directories to classify packages and artifacts into different categories.
* Add documentation for the expected layout of artifacts/
* Remove the need for static analysis to determine which packages go to which project
* Add the MSBuild property "IsProductPackage" to .csproj files which ship as a package to NuGet.org.
Replaces package references the following packages with local code:
Microsoft.AspNetCore.Certificates.Generation.Sources
Microsoft.Extensions.CopyOnWriteDictionary.Sources
Microsoft.Extensions.ClosedGenericMatcher.Sources
Microsoft.Extensions.ObjectMethodExecutor.Sources
Microsoft.Extensions.PropertyActivator.Sources
Microsoft.Extensions.PropertyHelper.Sources
Microsoft.Extensions.RazorViews.Sources
Microsoft.Extensions.SecurityHelper.Sources
Microsoft.Extensions.StackTrace.Sources
Microsoft.Extensions.WebEncoders.Sources
Changes:
* Ensure IIS managed and pkg projects build after the native projects
* Update projects to build test
* Update CI checks to build on macOS and Linux
* Use package baselines to manage ANCM packages
All other properties (`Predicate`, `ResponseWriter` and `AllowCachingResponses`) have a setter but `ResultStatusCodes` doesn't.
Without a setter, reusing the same status to http status code mapping is impossible and leads to duplicate code that looks like this:
```csharp
private static void ConfigureHealthChecks(IApplicationBuilder app, HealthCheckServiceOptions options)
{
app.UseHealthChecks("/health", new HealthCheckOptions
{
ResultStatusCodes =
{
[HealthStatus.Healthy] = StatusCodes.Status200OK,
[HealthStatus.Degraded] = StatusCodes.Status400BadRequest,
[HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable
}
});
foreach (var name in options.Registrations.Select(e => e.Name))
{
app.UseHealthChecks($"/health/{name}", new HealthCheckOptions
{
Predicate = registration => registration.Name == name,
ResultStatusCodes =
{
[HealthStatus.Healthy] = StatusCodes.Status200OK,
[HealthStatus.Degraded] = StatusCodes.Status400BadRequest,
[HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable
}
});
}
}
```
With a setter, this code could be rewritten in a *don't repeat yourself* (DRY) way:
```csharp
private static void ConfigureHealthChecks(IApplicationBuilder app, HealthCheckServiceOptions options)
{
var resultStatusCodes = new Dictionary<HealthStatus, int>
{
[HealthStatus.Healthy] = StatusCodes.Status200OK,
[HealthStatus.Degraded] = StatusCodes.Status400BadRequest,
[HealthStatus.Unhealthy] = StatusCodes.Status503ServiceUnavailable
};
app.UseHealthChecks("/health", new HealthCheckOptions
{
ResultStatusCodes = resultStatusCodes
});
foreach (var name in options.Registrations.Select(e => e.Name))
{
app.UseHealthChecks($"/health/{name}", new HealthCheckOptions
{
Predicate = registration => registration.Name == name,
ResultStatusCodes = resultStatusCodes
});
}
}
```
* Workaround problems when opening solution files in Visual Studio (#4569)
Changes:
* Condense Routing.sln into HttpAbstractions.sln
* Workaround NU1105 by adding all ProjectReferences to the .sln
* Workaround exceptions in the ReferencesHostBridge by moving Reference items to a temporary item group
* Add a 'startvs.cmd' script for launching VS with the right env variables
* Remove RangeHelper test project
* Move RangeHelper tests into StaticFiles.Tests and add target for NPM restore
* Convert Session to use Reference and move to Middleware folder (#4576)
* Add RoutingSample.Web to HttpAbstractions.sln
Changes:
* Condense Routing.sln into HttpAbstractions.sln
* Workaround NU1105 by adding all ProjectReferences to the .sln
* Workaround exceptions in the ReferencesHostBridge by moving Reference items to a temporary item group
* Add a 'startvs.cmd' script for launching VS with the right env variables
* Remove RangeHelper test project
* Move RangeHelper tests into StaticFiles.Tests and add target for NPM restore