* Add Windows 7 and 8.1 testing on Helix
* Install SQL Server on-demand in Helix test queues
* Only install mssql on Windows runs
* Use exit /b
* Add targets to better support running helix locally
* Set maxretrycount to 2
* Handle IIS issues on win7/win8
* Make HelixPreCommand's fail the workitem
* Add a pre-generated test cert of IIS Express
* Update helix doc and ignore netsh script failures
* Fix bug in detecting Windows queues and disable Win 7 until we have queues ready
* Fix HttpSys functional tests on Helix
* Add yarn.lock file for NodeServices
* Remove references to 'npm install' (causes double-download of node modules) and replace npm commands in package.json with yarn for consistency
* Upgrade yarn to 1.15.2
Creating a sample for the header propagation package and some various
misc UX improvements based on building the sample.
A small list:
- allow duplicate inbound names
- de-dupe based on outbound names
- add sugar for configuration
- simplify pattern for transforming values
- add error message for missing middleware
Also a few small perf things.
I started this out by wanting to remove the following from the
configuration pattern:
```C#
options.Headers.Add("X-TraceId", null);
```
This pattern with null is undiscoverable, but we didn't provide
something simpler. The most common case was to add a custom collection
type so we can define sugar methods.
The next realization is that in practical case (dist tracing sample) you
either way to *key* off of the same inbound header twice, or you don't
have an inbound header at all, and you will synthesize the value every
time. This means that the way we're treating inbound header names is a
bit wrong. We don't want inbound header names to be unique, we want
*outbound header names to be unique*.
Next, I want to consolidate DefaultValue and ValueFactory. The problems
I saw with this:
- DefaultValue is a trap. It's rare to use a static value.
- ValueFactory really wants the header name *and* value
I think what's there now is much more terse to work with.
Attempt to improve reliability of running yarn commands. Our project structure might cause yarn to be launched multiple times. According to yarn docs, this option should avoid conflicts between multiple instances of yarn
https://yarnpkg.com/en/docs/cli/#toc-concurrency-and-mutex
Fixesaspnet/AspNetCore-Internal#2245
Our tests were flaking out due to this possible race where the directory browser middleware enumerates the directory but a file is deleted while we're formatting the response. This change just catches the FNF/DNF exceptions and suppresses the file from the directory listing
* Update dependencies from https://github.com/dotnet/arcade build 20190423.2
- Microsoft.DotNet.GenAPI - 1.0.0-beta.19223.2
* Adjust to GenApi change in `enum` ordering
- was sorted by name, now by value
* Chain coherent dependencies up through Extensions to EF Core packages
- should reduce incoherent PRs we get from `darc`
- react to AspNetCore-Tooling breaking changes
- use C# Preview version in Blazor integration tests
- update `EnsureOptions_ConfiguresDefaultParseOptions` test to match new C# version default
- react to new newline encoding behavior; thanx @ajaybhargavb!
- update product code and tests to use new GetItem API; thanx @NTaylorMullen!
- RazorProjectFileSystem breaking change
- update ref assemblies
- react to EF Core breaking changes
- react to EF Core method rename
- react to aspnet/EntityFrameworkCore@ccfc5edbc7
- react to aspnet/EntityFrameworkCore@6cb41531df breaking change
- disable new analyzer in `ScratchDatabaseFixture`
- skip `MvcTemplate_NoAuthImplAsync(...)` test for F#
- #8996
- exclude some runtime assemblies from crossgen; thanx @BrennanConroy!
- add direct references to Mvc in AzureAD samples
- unclear why the reference is no longer pulled in transitively
* Run `darc` to grab the latest
- CoreFx packages with version 4.6.0-preview4.19204.1 to ensure coherency
- core-setup packages with version 3.0.0-preview4-27604-05 to ensure coherency
- Extensions packages with verisn 3.0.0-preview4.19204.2 to ensure coherency
- EntityFrameworkCore packages with version 3.0.0-preview4.19204.7 from build 20190404.7
- AspNetCore-Tooling packages with version 3.0.0-preview4.19204.2 from build 20190404.2
* [MVC][Components] Prerendering + Robust reconnect
* Relayers prerendering support on a separate package on top of MVC and
components.
* Implements robust reconects with acknowledgements from the client.
* Improves interactive prerendering with the ability to reconnect to
prerendered components.
* Removes the need to register components statically when prerendering
them.
* Removes the need of using an element selector when prerendering an
interactive component.
* Updates the templates to use the new fallback routing pattern and
reenables the components test.
* Adds eslint to the Typescript project to help maintain a consistent
style.
* Adds logging to support better debugging based on the pattern used by
signalr.
* Fixes exception handling on the server to always report exceptions correctly to the client.
- This change introduces the concept of an IDeveloperPageException filter that runs whenever the developer exception page has encountered an error. It follows the middleware pattern (chain of resposibility) which allows short circuiting or decorating the default logic.
- Added tests
* Ported HeaderPropagation from aspnet/Extensions
* Introduced Middleware
* Refactored middleware logic
* Refactored builder extensions
* Copyright notice
* Test for friendly exception on Builder
* Fixed header name selection when no output name specified
* Set comparer for the dictionary of headers
* Refactored configuration as Dictionary
* Renamed state objects
* renamed OutboundHeaderName in configuration
* Changed DefaultValuesGenerator to ValueFactory
* Missing docs
* Removed AlwaysAdd and added tests for null entry in configuration
* Improved docs
* Update src/Middleware/HeaderPropagation/src/DependencyInjection/HeaderPropagationExtensions.cs
Co-Authored-By: alefranz <alessio@franceschelli.me>
* Moved dependency injection extensions
* DI: reused ServiceCollection extension in the HttpClientBuilder one
* Moved service registration
* Update src/Middleware/HeaderPropagation/src/HeaderPropagationEntry.cs
Co-Authored-By: alefranz <alessio@franceschelli.me>
* more docs
* Improved docs
* Update src/Middleware/HeaderPropagation/src/HeaderPropagationValues.cs
Co-Authored-By: alefranz <alessio@franceschelli.me>
* Fixed build
* Update eng/SharedFramework.Local.props
Co-Authored-By: alefranz <alessio@franceschelli.me>
* Updated tests for null config
* Reversed condition on HeaderPropagationMessageHandler as suggested
* Added docs for HeaderPropagationMessageHandler
* Changed proj to ship package to NuGet
* Make endpoint middleware explicit
This change makes the endpoint middleware explicit again, and updates
all of the templates.
The other change here is make UseEndpoints be the place where you
register endpoints. This is vital because it puts your code visually at
the point of the pipeline where it executes.
Lastly, I removed support for UseMvc with endpoint routing. This is
causing issues for some security features, and we're moving in the
direction of trying to make the middleware heavy implementation required
in 3.0. There are some issues we won't be able to fix in MVC if we can't
unambiguously know if UseMvc was used or the middleware.
* Improved selenium start and tear down
* Selenium is set up and torn down in an assembly fixture.
* Selenium is initialized lazily and in a non-blocking way.
* Selenium processes are tracked as part of the build and their pids
written to a file on disk for cleanup in the event of unexpected
termination of the test process.
* Browser fixture retries with linear backoff to create a remote
driver. Under heavy load (like when we are doing a simultaneous NPM
restore) the selenium server can become unresponsive so we retry
three times, with a longer comand timeout allowance each time up to
a max of 3 minutes.
* Moved test project setup to build time instead of runtime.
* Added target PrepareForTest to create the required files for testing
* The template creation folder.
* The template props file to use our built packages.
* The folder for the custom hive.
* Added assembly metadata attributes to find all the data we need to
run the tests.
* Path to the artifacts shipping packages folder.
* Path to the artifacts non-shipping packages folder.
* Path to the test templates creation folder.
* Path to use for the custom templating hive used in tests.
* Proper cleanup as part of the build
* Remove the test templates creation folder.
* Remove the test packages restore path.
* Recreate the test templates creation folder.
* Recreate the test packages restore path.
* Generated Directory.Build.Props and Directory.Build.Targets in the
test templates creation folder.
* Cleaned up potentially stale templatetestsprops.
* Improved test flows
* Initialization is done lazily and asynchronously.
* Selenium
* Browser fixture
* Template initialization.
* Flattened test flows to avoid assertions inside deep callstacks.
* All assertions happen at the test level with improved error messages.
* With the exception of the migrations assertions.
* Assertions contain information about which step failed, for what
project and what failure details.
* Broke down tests to perform individual steps instead of mixing build
and publish.
* Publish project.
* Build project. (Debug)
* Run built project.
* Run published project.
* Concentrated build logic into the Project class.
* Context between the different steps of a test is maintained in
this class.
* All operations that require coordination are performed within this
class.
* There is a lock for dotnet and a lock for nodejs. When building
SPAs we acquire the nodejs lock to correctly prevent multiple
runs of nodejs in parallel.
[ApiAuthorization template cleanups]
* Fix preview3 issues with breaking changes on Entity framework by
manually configuring the model in ApiAuthorizationDbContext.
* Add app.db to the project file when using local db.
* Fix linting errors on angular template.
* Fix react tests
* Add tests to cover new auth options in the SPA templates.
This change makes the SpaDefaultPageMiddleware noop when an endpoint has
been chosen. This is a problem today because this usually runs after
routing, but its always terminal.
So even if endpoint routing selected something, this would still serve
the default file. We're adding more things that fill this niche, but it
seems like a good idea to fix the existing stuff.
This is a new routing feature that integrates static files to serve a
static file when routing doesn't match anything else.
This is a scenario that's covered by SPA services today, but given the
improvements to routing it makes much more sense to move lower in the
stack.
Teaches all of the static files middleware (incl default files,
directory browser) to noop when an endpoint is selected. This is
desirable so you can place them after routing if you want with no ill
effect.
Changes:
* Make Visual Studio 2019 a prerequisite for building this repo
* Update .sln files
* Update Windows SDK to 17134
* Update developer docs
* Disable ANCM tests
* Update to .NET Core SDK 3.0 Preview 2
* Use Microsoft.NET.Sdk.Razor as a package consistently accross the repo
* React to changes in metadata from Microsoft.NETCore.App
* React to changes in .NET Core SDK
* Attempt to workaround CodeCheck.ps1 failure which doesn't repro locally or on different agents. Possibly due to differences in the version of the PowerShell task?
* Remove dead YML file
* Rename usages of win7-{x64,x86} to win-{x64,x86}
* Update KoreBuild to 3.0.0-build-20190219.1
- #7052
- add MvcOptions.MaxModelBindingCollectionSize` and `MvcOptions.MaxModelBindingRecursionDepth`
nits:
- update syntax of a few `Resources.Designer.cs` files (I ran `/t:resx` on Mvc.sln)
- take VS suggestions in a few test classes
When a `<Reference>` is named `*.Sources`, set PrivateAssets=All (exclude from generated nuspec) and IncludeAssets=ContentFiles (only consume content files, not .dll's)
Changes:
* Add support for a property, `IsAspNetCoreApp`, in the .csproj file of assemblies which are part of the shared framework.
* Remove unused dependencies
* Remove reference which have become part of 'netcoreapp3.0'
Add new command line parameters for working with the project:
* `-NoBuild`, `-NoRestore` - these already existed, but users found it hard to discover this powershell syntax: '-build:$false'
* `-Arch`/`--arch` - set the target CPU architecture to build. Defaults to x64
* `--os-name` - on non-Windows builds, manually specify if the build should target Alpine. generic Linux, or MacOS
* Rename flags used to build specific project types. The pattern now is `--build-$(group)` or `--no-build-$(group)` (In PowerShell its `-Build$(Group)` or `-NoBuild$(Group). Example: -NoBuildJava
Changes to build definitions:
* Update the ci build definition to build all supported architectures
* Support publishing multiple artifacts per job
Other changes:
* `-NoBuild` implies `-NoRestore`
* Add new properties, `TargetArchitecture`, `TargetOsName`, and `TargetRuntimeIdentifier`
* Replace usages of `SharedFxRid` with these new properties
* To make `--no-build-nodejs` actually work, replaced Components.Browser.JS.csproj with Components.Browser.JS.npmproj
* Fix errors when building for win-arm on a clean machine
* Fix a few other project errors, like using the wrong syntax for DefaultItemExcludes, or using the wrong Platform value for x86
Changes:
* Remove obsolete targets which are unnecessary now that this repo no longer builds git submodules in a separate build process
* Remove the need for static analysis of 'ArtifactInfo' items
* Simplify how the code signing task is configured
* Remove unused repo tasks
* Remove duplicate lists of external dependencies and packages to be produced
* Remove obsolete build definition
* Remove obsolete build script parameters
* Add VisualStudioSetupOutputPath
- WebSocketProtocol.CreateFromStream makes the netstandard ManagedWebSocket which uses the inefficient versions of Stream overloads.
- Updated the samples to use the new Memory<byte> overloads
.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