Commit Graph

16067 Commits

Author SHA1 Message Date
Ryan Nowak c725089e8b Add missing conversions on EventCallbackFactory 2019-02-19 15:48:16 -08:00
BrennanConroy f37d30833d
Ignore unexpected stream items and completions from client (#7511) 2019-02-19 15:25:50 -08:00
Doug Bunting 14b7184c09
Improve documentation of `BinderType` and `BindingSource` properties (#7218)
- add regression test for #4939
- add `[BindProperty]` doc comments
- add `<remarks>` to `BinderType` properties that recommend setting `BindingSource` in some cases

smaller issues:
- catch invalid `BinderType` values up front
- complete `BindingSource.ModelBinding` implementation: `IValueProvider` filtering was faulty

nits:
- accept VS suggestions e.g. remove unused variables
- "model binder" -> `<see cref="IModelBinder" /> implementation` in some doc comments
2019-02-19 15:22:04 -08:00
Doug Bunting 3e0c75187c
Place limits on model binding collection size and recursion depth (#7214)
- #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
2019-02-19 15:17:56 -08:00
Ryan Brandenburg 69abefa06f
[Design] Harden template package installer and fix name (#7624)
Harden template package installer and fix name
2019-02-19 14:41:59 -08:00
Mikael Mengistu d1fac57734
Ensure SignalR client messages are processed in order (#7697) 2019-02-19 11:48:22 -08:00
TimTim dffe9abf6b Fix connection ID (#7681) 2019-02-18 17:13:53 -08:00
Ben Adams 3e47fa7c69 Inline BufferWriter .ctor (#7674) 2019-02-17 21:30:29 -08:00
Ryan Nowak 98fe8a8328 Improvements to bind and event handling
The changes here make event dispatching (including bind) more
user-friendly by avoiding the need for manual calls to StateHasChnaged.

We also introduce a new type `EventCallback` (and `EventCallback<T>`).
This is a new primitive that is like a super-powered version of a
delegate. When writing a component that accepts delegates as parameters,
consider using `EventCallback` for the following reasons:
- Allows consumer to pass a variety of different delegate signatures
- Does proper event dispatching and error handling

Using `EventCallback` will eliminate most of the remaining cases where a
manual `StateHasChanged` is required when components are passing content
and delegates to each other.

`EventCallback` is inherently async for the reason that this is really
the only way to provide correct error handling.

-----

The fix for this will be two-phase by first creating a set of APIs that
can be targeted by the compiler that has the desired behaviour and then
updating the compiler to target this new infrastructure.
2019-02-17 15:58:08 -08:00
James Newton-King cc7b35439c
Add test for HTTP method metadata order (#7225) 2019-02-18 09:20:12 +13:00
Ben Adams 6b7e821913 Don't hardcode fixed size for GetMemory in ChunkedTests 2019-02-17 09:29:57 -08:00
Chris R b571246c93 Suppress warnings for obsolete Extensions types 2019-02-17 09:29:57 -08:00
Justin Kotalik 49a720c1dc Fix GetMemory to not pass in size hint 2019-02-17 09:29:57 -08:00
Mikael Mengistu af43b80b1a Make server timeout configurable (#7340) 2019-02-17 07:57:36 -08:00
Stephen Halter 8ae4c4dbd6 Add SignalR web worker sample and test (#7378) 2019-02-17 07:52:18 -08:00
Ben Adams 4646ed5618 Work around WriteBarrier assign for nulling struct (#7659) 2019-02-16 20:09:39 -08:00
David Fowler 0fd753bfc2
Align host behavior with respect to exceptions (#7657)
- Don't catch errors in IHostedService.StartAsync
- Only catch errors when executing StopAsync but rethrow an aggregate
- Updated the tests
2019-02-16 19:09:14 -08:00
David Fowler 799b91a324
Change the namespace of the extension methods (#7651)
- The other routing extension methods use Microsoft.AspNetCore.Builder
2019-02-16 00:36:59 -08:00
James Newton-King c2d1ab925e
Remove obsolete APIs from routing (#7371) 2019-02-16 18:37:51 +13:00
Mikael Mengistu c806c5a61a
Wait for stop to complete in SignalR test to prevent flakiness. (#7634) 2019-02-15 18:42:04 -08:00
Ben Adams 639d290b19 Lock-free IOQueue (#6154)
Second half of https://github.com/aspnet/AspNetCore/pull/4060
2019-02-15 18:26:30 -08:00
Chris Ross 191fb03de7
ITlsHandshakeFeature requires Win8+ (#7629) 2019-02-15 16:28:04 -08:00
Justin Kotalik 60b00fa007
Make reads that return canceled ReadResult throw (#7618) 2019-02-15 16:11:57 -08:00
Chris Ross 93a24b03bb
Disable AllowSynchronousIO by default in all servers #4774 (#5120)
* Disable AllowSynchronousIO by default in all servers
2019-02-15 16:05:49 -08:00
Pranav K 7daa0e0145
Convert BlazorExtension to SDK style project (#7588)
* Convert BlazorExtension to SDK style project

Fixes https://github.com/aspnet/AspNetCore/issues/7135
2019-02-15 15:14:19 -08:00
Pranav K fe1c2c84ee
Remove uses of JSRuntime.Current (#7599)
* Remove uses of JSRuntime.Current

Prerequisite for https://github.com/aspnet/AspNetCore/issues/6828
2019-02-15 15:14:00 -08:00
Pavel Krymets 9afdc48f13
Disable remote symbol loading for dump files in CI (#7620) 2019-02-15 14:42:36 -08:00
Chris Ross cc62bcebfc
Skip HttpSys.Https tests on Helix Internal/#1816 (#7578) 2019-02-15 12:33:23 -08:00
David Fowler 5ef51822de
Added endpoint routing support (#7608)
- Basic endpoint routing support to for SignalR hubs, ConnectionHandler and IConnectionBuilder endpoints
- Updated all functional tests and samples to use it
- Added all attributes as metadata from Hubs and ConnectionHandlers
- Added a test to verify client is rejected if auth is ineffective
2019-02-15 12:32:01 -08:00
Pavel Krymets 6bafb7cb6f
Log before releasing streams and firing tokens (#7583)
Might fix: https://github.com/aspnet/AspNetCore-Internal/issues/1659

I think writes complete too fast so we don't observe when the message gets logged
2019-02-15 10:41:21 -08:00
Justin Kotalik 25f1f59378
Make first write use the same BufferWriter (#7505) 2019-02-15 08:26:57 -08:00
Nikita Potapenko 98ad532822 Removed comments
Fixes #7579
2019-02-15 13:20:14 +00:00
Ajay Bhargav Baaskaran c565386a3e
Merge pull request #7597 from aspnet/ajbaaska/merge-master
Merge branch 'release/2.2' to master
2019-02-14 23:20:18 -08:00
Ajay Bhargav Baaskaran b3d3f5e7fb Updated missed slns 2019-02-14 17:35:48 -08:00
Nate McMaster 6defaadb8b
Update location of obj/ and bin/ directories to match Arcade conventions (#7585) 2019-02-14 16:27:53 -08:00
Ajay Bhargav Baaskaran 7a26d27e8b Merge branch 'release/2.2' 2019-02-14 16:08:51 -08:00
Ajay Bhargav Baaskaran a8277408d9
Merge pull request #7542 from dotnet-maestro-bot/merge/release/2.1-to-release/2.2
[automated] Merge branch 'release/2.1' => 'release/2.2'
2019-02-14 10:43:50 -08:00
Chris Ross 44e6813452
Use new version of h2spec #6691 (#7559) 2019-02-14 09:28:58 -08:00
Joseph Musser 50587d7d6d Fix “must comprised of” (#7519)
* Fix missing word

* Replace ‘comprise’ with simpler wording
2019-02-14 09:27:55 -08:00
BrennanConroy bca85b92fc
More C++ Client cleanup (#7551) 2019-02-14 08:31:15 -08:00
Ryan Brandenburg 6ea3f27dbb
Merge pull request #4565 from martinpe36/master
Update React-Redux client app to use TypeScript instead of JavaScript
2019-02-14 08:14:07 -08:00
Nate McMaster 0ec25d3167
Create new 'runtime pack' nuget packages for Microsoft.AspNetCore.App (#7475)
* Create a new package  - Microsoft.AspNetCore.App.Runtime.${rid} - which contains crossgen-ed versions of shared framework assemblies. This will be used by the SDK to replace rid-split packages
* Add a task which can generate the .deps.json file for the shared framework. Unlike the existing task we have, this does not rely on consuming a .deps.json file generated by first running a restore on packages.
* Move the reference to xunit.runner.console into the normal targets and files for managing dependencies
* Produce binlogs during build
2019-02-14 07:25:13 -08:00
Vakhtangi Abashidze a314cb2773 PointerID type string replaced to long (#7426)
Solves issue [#7418](https://github.com/aspnet/AspNetCore/issues/7418) - Blazor onpointerdown event gives error
2019-02-14 03:24:13 -08:00
Stephen Halter 132a1ad31b
Remove capture of "this" from local function (#7467) 2019-02-14 00:21:39 -08:00
Doug Bunting d102d10a81 Update branding to 2.2.3
- new version
- update baselines
- grab latest released Microsoft.NetCore.App and Microsoft.NETCore.DotNetAppHost

nit:
- updated ZipManifestGenerator's README.md to use 2.2 examples
2019-02-13 23:15:58 -08:00
James Newton-King 05895cde64
Fix endpoint routing flaky test on build server in 2.2 (#7489) 2019-02-14 17:48:22 +13:00
Nate McMaster 94109e6655
Add package override manifest to the targeting pack (#7555) 2019-02-13 19:32:47 -08:00
Ryan Nowak f2a1a4542e
Introduce dynamic endpoints and fix #7011 (#7445)
* Add IDynamicEndpointMetadata for dynamic endpoints

* Use a dynamic endpoint policy for pages
2019-02-13 18:52:07 -08:00
Pranav K 27e54a1b7a Skipping flaky test 2019-02-13 16:45:36 -08:00
Pranav K 9053bc6e29 Re-enable skipped runtime compilation tests 2019-02-13 16:45:36 -08:00
BrennanConroy 9de42d516e
Copy Kestrel perf changes (#7480) 2019-02-13 16:31:37 -08:00
Ajay Bhargav Baaskaran a2f27426a5 Add missed tests 2019-02-13 16:25:31 -08:00
Jeremy Kuhne a02ac20183 Use var 2019-02-13 16:20:34 -08:00
Jeremy Kuhne 2c649b2409 Use .NET Core SequenceReader
Remove BufferReader and use SequenceReader<T> which now ships in CoreFX.

This is related to https://github.com/aspnet/KestrelHttpServer/pull/3068 which builds on the functionality added to the reader.
2019-02-13 16:20:34 -08:00
Chris Ross d1aa53721b
Add launchSettings.json to worker template (#7550)
* Add launchSettings.json to worker template #7545
* Switch back to the Web SDK
2019-02-13 15:54:15 -08:00
Ajay Bhargav Baaskaran 0c2ee920a1 Merge branch 'release/2.1' into release/2.2 2019-02-13 14:52:38 -08:00
Nate McMaster 338de4710a
Automatically set 'PrivateAssets=All' for .Sources references (#7539)
When a `<Reference>` is named `*.Sources`, set PrivateAssets=All (exclude from generated nuspec) and IncludeAssets=ContentFiles (only consume content files, not .dll's)
2019-02-13 14:31:15 -08:00
Pranav K cddbc2e888
Improve Components error handling (#7165)
* Improve Components error handling

* Change event handlers IHandleEvent, IHandleAfterEvent to be async.
* Return faulted tasks to Renderer instead of handling exceptions in ComponentBase
* Use ILogger in RemoteRenderer, and log to console in WebAssemblyRenderer
* Cleaning up touched files

Fixes https://github.com/aspnet/AspNetCore/issues/4964
2019-02-13 14:22:46 -08:00
Ajay Bhargav Baaskaran 4cceccd568
Make Mvc repo folder layout consistent (#7518) 2019-02-13 10:53:39 -08:00
Mikael Mengistu 3d3ad96206
SignalR Java Client LongPolling Transport (#6856) 2019-02-13 10:27:07 -08:00
Nate McMaster 2ac4619635
Replace custom targets for generating assembly attributes and source control info by using SDK features (#7504) 2019-02-13 10:22:03 -08:00
Chris Ross 06d7fe73a9
Implement ITlsHandshakeFeature for HttpSys (#7284) 2019-02-13 08:39:45 -08:00
Nate McMaster 3fd8a97af2
Add targets to generate the list of shared framework assemblies from project property (#7510)
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'
2019-02-12 23:00:19 -08:00
Doug Bunting 5bbf7109a5
Fail `ComplexTypeModelBinder` after `CanCreateModel(...)` in some cases (#6793)
- #4802 and #6616
- also reduces the impact incorrect metadata as in #4939
- postpone some property binding in `ComplexTypeModelBinder`
2019-02-12 22:15:43 -08:00
Hao Kung 9ab72f6202
Skip flaky Components test on Helix (#7488) 2019-02-12 21:15:28 -08:00
Doug Bunting 447306cbb9
Merge branch 'release/2.1' into release/2.2 2019-02-12 19:32:03 -08:00
Doug Bunting 5bb5bafbed Update branding to 2.1.9 2019-02-12 19:12:20 -08:00
BrennanConroy 1c6651a1ae
Fixup handshake logic and layering (#7470) 2019-02-12 17:06:56 -08:00
Chris Ross 8f72b87981
Enable docker for the worker template #6817 (#7508) 2019-02-12 15:09:27 -08:00
Pranav K 173b2f91fb
Trim Async suffix on action names (#7420)
Fixes https://github.com/aspnet/AspNetCore/issues/4849
2019-02-12 13:30:38 -08:00
Javier Calvarro Nelson 6827bb7443
[Templating] Razor class library for components (#7461)
* [Components] Razor class library for components
* Updates the Razor Class Library to be a portable components library by
  default.
* Adds an option to support the old RCL that includes support for Views
  and pages.
* Usage:
  * `dotnet new razorclasslib` produces the same traditional Razor Class Library.
  * `dotnet new razorclasslib -s false` produces a Razor Class Library without views and pages support.
2019-02-12 06:08:11 -08:00
David Fowler c1bc210e8e
Fix returning buffered data after stream is drained (#7476)
- Change TryRead to return the buffer if the Stream is completed
2019-02-11 20:45:15 -08:00
Chris Ross 05923e9151
Get worker tempalte showing up in VS (#7478) 2019-02-11 20:25:17 -08:00
Ryan Nowak acd1cf3251
Update MVC/Routing Startup Experience (#7425)
* Relayer MvcEndpointDataSource

Separates the statefulness of the data source from the business logic of
how endpoints are created.

I'm separating these concerns because one of the next steps will split
the MvcEndpointDataSource into two data sources.

* Simplify MvcEndpointInfo

Removing things that are unused and leftovers from the 2.2 design of
this feature.

* Remove per-route conventions

Removes the ability to target endpoint conventions
per-conventional-route. This was a neat idea but we have no plans to
ship it for now.

Simplified MvcEndpointInfo and renamed it to reflect its new purpose.

* Remove filtering from MvcEndpointDataSource

This was neat-o but we're not going to ship it like this. We're going to
implement filtering in another place. Putting this in the data source is
pretty clumsy and doesn't work with features like application parts that
need to be baked in addservices

* Simplify ActionEndpointFactory

* Split up data sources

* Use UseRouting in functional tests

I've rejiggered our functional tests to de-emphasize UseMvc(...) and
only use it when we're specifically testing the old scenarios.
UseMvc(...) won't appear in templates in 3.0 so it's legacy.

* Update templates

* Add minor PR feedback

* one more
2019-02-11 19:18:05 -08:00
Justin Kotalik 2a9caa0343
AsTask => GetAsTask() (#7468)
* AsTask => GetAsTask()

* Another spot

* Another spot
2019-02-11 16:55:28 -08:00
Daniel Roth 2e1aa139f7
Update metadata for the Blazor VSIX (#7473) 2019-02-11 16:55:09 -08:00
dotnet-maestro-bot 98be5a3ca5 Fix flaky process output reading for dotnet-watch tests (#7173) (#7403) 2019-02-11 16:47:58 -08:00
Ryan Nowak c5d8f8c34e Update CORS package.json and friends
This is what NPM wants to do - why argue?
2019-02-11 16:19:27 -08:00
Ryan Nowak 5a291d0bc0 Fix #4212 area ambient value page->controller
This change enhances our ambient value logic to also deal with required
values. In 2.2 we introduced a 'required values' semantic to allow route
values to appear "to the left" of a route pattern for the purpose of
ambient values copying. This is a complicated way of saying "when you
like to a different endpoint then discard the ambient values".

What we didn't consider is that some ambient values are special (like
area). So basically, we'll allow an ambient value to be used if it's
part of the required values - even if we've already decided to discard
the ambient values.

This is a pretty surgical fix and only affected the desired scenario
based on tests.

-----

I also removed an optimization that I think is broken. I put an earlier
optimization in place that attempted to count ambient values as they
were "seen" to try and avoid some extra copying. This copying loop has a
cost even if it no-ops which is what I was trying to prevent.

Unfortunately since we added 'required values' - it's now possible for
an ambient value to be double-counted, which makes this optimization
incorrect.
2019-02-11 15:58:33 -08:00
Pranav K 88ae930fad
Remove obsolete APIs from MVC (#7444)
* Remove obsolete APIs from MVC
Fixes https://github.com/aspnet/AspNetCore/issues/7322
2019-02-11 15:27:38 -08:00
Justin Kotalik e5f31f264c Another spot 2019-02-11 15:10:30 -08:00
N. Taylor Mullen dfddc4e8ff [MVC] Remove obsolete APIs
- Removed ViewsFeatureProvider
- Removed PageArgumentBinder and its internal implementation DefaultPageArgumentBinder.
- Removed corresponding test classes/methods for all the above.
- Reacted to class/member changes in dependencies.

#7326
2019-02-11 14:56:30 -08:00
Chris Ross 597c8434d5
Background Worker template (#7401) 2019-02-11 14:53:50 -08:00
Justin Kotalik 371c29577b Another spot 2019-02-11 14:42:02 -08:00
Justin Kotalik 84cdac952a AsTask => GetAsTask() 2019-02-11 13:58:25 -08:00
David Fowler a5ba735a0f
Remove PlatformBenchmarks from sln (#7440) 2019-02-11 12:38:20 -08:00
Pavel Krymets 037a5b0231
Add more logging to a failing tests and move dumps to logs directory (#7462) 2019-02-11 12:14:05 -08:00
David Fowler 476a1827f4
Made changes to stream <-> pipe adapters (#7407)
- Use the array pool by default when the shared memory pool is specified for both the StreamPipeReader and StreamPipeWriter
- Support allocating unpooled memory if the StreamPipeWriter is asked for memory outside of the max pool size
2019-02-11 11:15:36 -08:00
Ben Adams 3276870d6a Remove unnecessary Flush (#7424) 2019-02-11 11:02:00 -08:00
Ben Adams 6d42ff7c38 Don't write empty data for Flush (#7415) 2019-02-11 11:01:36 -08:00
Javier Calvarro Nelson dbf746d210
[Antiforgery][Components][CORS] Remove obsolete APIs (#7459)
#7325
#7319
#7324
2019-02-11 10:38:31 -08:00
Doug Bunting 58e6d78549 Suppress Razor warnings about missing doc comments 2019-02-11 10:35:48 -08:00
Artak 7c9959934a Fixed a type reference in a doc comment.
Fixes #7416
2019-02-11 09:06:34 -08:00
Ben Adams 704094b199 Use C#7.3's ReadOnlySpan<byte> optimization for static data (#7422) 2019-02-11 07:40:40 -08:00
Martin Costello 762206a5d8 Fix typo in package description (#7435)
Fix incorrect spelling of "storage".
2019-02-10 16:25:57 -08:00
David Fowler 3be85751d5
Make Hosting.sln compile in vs (#7431) 2019-02-10 16:24:33 -08:00
kishanAnem c1ce7b9a77 ValidationSummary doesn't display property errors if ModelState and ModelMetadata meets the specific conditions #4831
Hi @dougbu

I removed test which is naming conflicts.
and closing #7221 PR
2019-02-09 13:11:07 -08:00
Martin Costello e465013063 Remove local item group (#7412)
Remove local development item group accidentally added by #7110.
2019-02-09 12:13:32 -08:00
Joni 9e06cfb7f8 Fix typo in HttpResponseWritingExtensions (#7413)
Fix typo WriteMutliSegmentEncoded => WriteMultiSegmentEncoded
2019-02-09 08:14:11 -08:00
David Fowler 8f49bdf195
More efficient preface parsing (#7406)
- Slice before turning the buffer into a Span
- Use SequenceEqual instead of a loop
2019-02-08 21:13:42 -08:00