Skip to content
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

Type check in shared generic doesn't eliminate casts to/from confirmed exact type #49614

Open
benaadams opened this issue Mar 14, 2021 · 12 comments
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue
Milestone

Comments

@benaadams
Copy link
Member

benaadams commented Mar 14, 2021

From #49608 (review)

A type check e.g. if (typeof(T) == typeof(string)) in a shared generic doesn't eliminate casts to and from a confirmed exact type

using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;

public class HashSet<T>
{
    private IEqualityComparer<T>? _comparer;

    public HashSet(IEqualityComparer<T>? comparer)
    {
        if (comparer is not null && comparer != EqualityComparer<T>.Default) 
        {
            _comparer = comparer;
        }

        if (typeof(T) == typeof(string))
        {
            // Double casts to concrete and back to generic not eliminated

            _comparer = (IEqualityComparer<T>?)
                NonRandomizedStringEqualityComparer.GetStringComparer(
                    (IEqualityComparer<string>?)_comparer);
        }
    }
}

public static class NonRandomizedStringEqualityComparer
{
    [MethodImpl(MethodImplOptions.NoInlining)]
    public static IEqualityComparer<string>? GetStringComparer(IEqualityComparer<string>? comparer)
    {
        return comparer;
    }
}

Data

Ideally the non Unsafe version:

if (typeof(T) == typeof(string))
{
    _comparer = (IEqualityComparer<T>?)NonRandomizedStringEqualityComparer
        .GetStringComparer((IEqualityComparer<string>?)_comparer);
}

Would produce the same asm as the Unsafe version:

if (typeof(T) == typeof(string))
{
    _comparer = Unsafe.As<IEqualityComparer<T>?>(
        NonRandomizedStringEqualityComparer.GetStringComparer(
            Unsafe.As<IEqualityComparer<string>?>(_comparer)));
}

However the regular casting includes a double cast even though its passed the typeof(TKey) == typeof(string) guard which implies the casts will always succeed.

G_M17833_IG07:
       mov      rcx, qword ptr [rsi]
       call     [CORINFO_HELP_READYTORUN_GENERIC_HANDLE]
       cmp      rax, qword ptr [(reloc)]
       jne      SHORT G_M17833_IG09
						;; bbWeight=1    PerfScore 8.00
G_M17833_IG08:
-      mov      rcx, qword ptr [rsi]
-      call     [CORINFO_HELP_READYTORUN_GENERIC_HANDLE]
-      mov      rdi, rax
       mov      rcx, gword ptr [rsi+24]
-      call     [CORINFO_HELP_READYTORUN_CHKCAST]
-      mov      rcx, rax
       call     [NonRandomizedStringEqualityComparer:GetStringComparer(IEqualityComparer`1):IEqualityComparer`1]
-      mov      rdx, rax
-      mov      rcx, rdi
-      call     [CORINFO_HELP_CHKCASTANY]
       lea      rcx, bword ptr [rsi+24]
       mov      rdx, rax
       call     [CORINFO_HELP_ASSIGN_REF]
-					;; bbWeight=0.50 PerfScore 10.38
+					;; bbWeight=0.50 PerfScore 4.38
G_M17833_IG09:
       nop      
						;; bbWeight=1    PerfScore 0.25

category:cq
theme:generics
skill-level:expert
cost:medium
impact:small

@benaadams benaadams added the tenet-performance Performance related issue label Mar 14, 2021
@dotnet-issue-labeler dotnet-issue-labeler bot added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI untriaged New issue has not been triaged by the area owner labels Mar 14, 2021
@AndyAyersMS
Copy link
Member

Hmm, let me investigate.

@AndyAyersMS
Copy link
Member

Assertion prop would be the place to catch this (the importer can't handle a conditional fact today, and is unlikely to be able to do so anytime soon).

And assertion prop doesn't' recognize this form of the class test:

N008 ( 23, 17) [000020] --CXG-------              *  JTRUE     void  
N007 ( 21, 15) [000017] J-CXG--N----              \--*  NE        int    $103
N004 ( 17,  8) [000008] --CXG-------                 +--*  CALL help r2r_ind long   HELPER.CORINFO_HELP_READYTORUN_GENERIC_HANDLE $203
N003 (  3,  2) [000007] #--X-------- arg0 in rcx     |  \--*  IND       long   $182
N002 (  1,  1) [000006] !-----------                 |     \--*  LCL_VAR   ref    V00 this         u:1 $80
N006 (  3,  6) [000013] #-----------                 \--*  IND       long   $188
N005 (  1,  4) [000012] H-----------                    \--*  CNS_INT(h) long   0xd1ffab1e class $1c4

The way AP is structured it is a bit hard to see what things it can handle, as it annoyingly splits out the "recognition" part from the "assertion gen" part. So it can recognize something and then end up not creating an assertion.

But in this case there's no recognition. This should happen in optAssertionGenJtrue. Currently the only form of "inline" type check this understands is when we have a GT_IND(GT_LCL_VAR) on one side. We'd need to generalize this to the case where we have to invoke a helper to figure out the object's type.

Once we have recognition we'd then need to generalize optCreateAssertion to re-recognize this case and generate a suitable subtype assertion.

@AndyAyersMS
Copy link
Member

Above tree is for prejit -- when jitting we see the results of an inline expanded runtime lookup (and in this case, with an embedded CSE def):

N014 ( 18, 23) [000021] -A-X--------              *  JTRUE     void  
N013 ( 16, 21) [000020] JA-X---N----              \--*  NE        int    <l:$107, c:$106>
N011 ( 13, 10) [000012] nA-X--------                 +--*  IND       long   <l:$1c6, c:$1c5>
N010 ( 10,  8) [000161] -A-X--------                 |  \--*  COMMA     long   $14b
N008 (  9,  7) [000159] -A-X----R---                 |     +--*  ASG       long   $VN.Void
N007 (  1,  1) [000158] D------N----                 |     |  +--*  LCL_VAR   long   V10 cse2          $14b
N006 (  9,  7) [000011] #--X--------                 |     |  \--*  IND       long   $14b
N005 (  6,  5) [000010] #--X--------                 |     |     \--*  IND       long   $14a
N004 (  4,  3) [000009] ---X---N----                 |     |        \--*  ADD       long   $1c4
N002 (  3,  2) [000007] #--X--------                 |     |           +--*  IND       long   $142
N001 (  1,  1) [000006] !-----------                 |     |           |  \--*  LCL_VAR   ref    V00 this         u:1 $80
N003 (  1,  1) [000008] ------------                 |     |           \--*  CNS_INT   long   48 $c1
N009 (  1,  1) [000160] ------------                 |     \--*  LCL_VAR   long   V10 cse2          $14b
N012 (  2, 10) [000016] H-----------                 \--*  CNS_INT(h) long   0xd1ffab1e class $243

We would want to recognize the [000012] subtree as fetching the type of V00 this.

@AndyAyersMS
Copy link
Member

Jitted case might be an example where we consider keeping / generalizing the "high level" wrapper IR around longer, so we can recognize what that big subtree means without having to explicitly pattern match it.

That is, early on in the jit we produce:

               [000021] ---X--------              *  JTRUE     void  
               [000020] ---X--------              \--*  NE        int   
               [000013] ---X--------                 +--*  RUNTIMELOOKUP long   0xd1ffab1e class
               [000012] n--X--------                 |  \--*  IND       long  
               [000011] #--X--------                 |     \--*  IND       long  
               [000010] #--X--------                 |        \--*  IND       long  
               [000009] ---X--------                 |           \--*  ADD       long  
               [000007] #--X--------                 |              +--*  IND       long  
               [000006] !-----------                 |              |  \--*  LCL_VAR   ref    V00 this         
               [000008] ------------                 |              \--*  CNS_INT   long   48
               [000016] H-----------                 \--*  CNS_INT(h) long   0xd1ffab1e class

which gives the gist of the idea. If we literally kept the above we'd still need to dig to find which local was being tested and deduce what was being looked up, but we'd at least know the diffing would pay off.

We might want something that describes the semantics more directly, but likely that means extra operands or operand like things... eg be able to view the operation both logically and in terms of the exact sequence of ops needed to carry it out.

But it's also possible this extra IR creates confusion.

@AndyAyersMS
Copy link
Member

Going to try and do a quick assessment of how often we might see this.

@AndyAyersMS
Copy link
Member

The jit lookup/compare pattern above isn't super common, maybe 80 hits across SPMI (out of ~750K methods, though some are crossgen so would not match)>

We would want to recognize the [000012] subtree as fetching the type of V00 this.

The above is incorrect.

What [000012] does is fetch the type of T from the dictionary, which is rooted by this. And the problem the jit faces is that knowing the type of T (or more precisely, knowing some dictionary slot must have a specific type in it at some point in the code) does not help the jit reason about what things it might find in other dictionary slots at that same point in the code. The jit has no way to know how the slot values are related.

So we either need to reason about this more abstractly, working back via tokens or sigs or something that describe these relationships, or else pass the buck over to the runtime an ask, "if we know dictionary slot X has value Y, what do we know about dictionary slot Z?"

This would help eliminate he first cast, where currently the jit says:

Considering optimization of castclass from 
00007FFD9731BA88 (System.Collections.Generic.IEqualityComparer`1[__Canon]) 
  to 
00007FFD9731BB58 (System.Collections.Generic.IEqualityComparer`1[[System.String, ...]])
  result of cast unknown, must generate runtime test

The jit should possibly be able to optimize away the second (outer) cast today even without knowing how the type are related:

Considering optimization of castclass from 
00007FFD9731BB58 (System.Collections.Generic.IEqualityComparer`1[[System.String, ...]]) 
   to 
00007FFD9731BA88 (System.Collections.Generic.IEqualityComparer`1[__Canon])

Seems like there is a missing case in CEEInfo::compareTypesForCast where we have an unshared from type and a shared to type, that we currently don't try to handle....

@benaadams
Copy link
Member Author

In this example where we settled ended up with a single cast from IEqualityComparer<string>? to IEqualityComparer<TKey>? on the return; passing the TKey version as object since all the tests are ReferenceEquals

if (typeof(TKey) == typeof(string))
{
IEqualityComparer<string>? stringComparer = NonRandomizedStringEqualityComparer.GetStringComparer(_comparer);
if (stringComparer is not null)
{
_comparer = (IEqualityComparer<TKey>?)stringComparer;
}
}

@AndyAyersMS
Copy link
Member

In this specific case the jit-time evaluation of the second cast is foiled by the contravariance of IEqualityComparer<T>.

So the jit can't remove that cast without knowing what __Canon really stands for, which brings us back to the dictionary problem mentioned above.

@AndyAyersMS
Copy link
Member

Going to mark this as future.

@AndyAyersMS AndyAyersMS removed the untriaged New issue has not been triaged by the area owner label Mar 19, 2021
@JulieLeeMSFT JulieLeeMSFT added this to the Future milestone Mar 26, 2021
@benaadams
Copy link
Member Author

Simpler version in dotnet/aspnetcore#31322 where the casts are HttpProtocol.Generated.cs#L395-L413

internal partial class HttpProtocol : IFeatureCollection
{
    internal protected IHttpRequestFeature? _currentIHttpRequestFeature;
    internal protected IHttpRequestBodyDetectionFeature? _currentIHttpRequestBodyDetectionFeature;
    internal protected IHttpResponseFeature? _currentIHttpResponseFeature;
    internal protected IHttpResponseBodyFeature? _currentIHttpResponseBodyFeature;
    internal protected IRequestBodyPipeFeature? _currentIRequestBodyPipeFeature;
    // ...

    TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
    {
        TFeature? feature = default;
        if (typeof(TFeature) == typeof(IHttpRequestFeature))
        {
            feature = (TFeature?)_currentIHttpRequestFeature;
        }
        else if (typeof(TFeature) == typeof(IHttpRequestBodyDetectionFeature))
        {
            feature = (TFeature?)_currentIHttpRequestBodyDetectionFeature;
        }
        else if (typeof(TFeature) == typeof(IHttpResponseFeature))
        {
            feature = (TFeature?)_currentIHttpResponseFeature;
        }
        else if (typeof(TFeature) == typeof(IHttpResponseBodyFeature))
        {
            feature = (TFeature?)_currentIHttpResponseBodyFeature;
        }
        ...

Though haven't checked this; might already just check method table rather than calling into CastHelpers.ChkCastAny as it does before this change

@benaadams
Copy link
Member Author

Yeah even with that source change it does look like:

IHttpRequestFeature? _currentIHttpRequestFeature;
TFeature? feature = default;
if (typeof(TFeature) == typeof(IHttpRequestFeature))
{
    feature = (TFeature?)_currentIHttpRequestFeature;
}

Generates all call to ChkCastAny for the cast; even though everything is confirmed (source side)

TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
{
            TFeature? feature = default;
 push        rbx  
 sub         rsp,30h  
 mov         qword ptr [rsp+28h],rdx  
 mov         rsi,rcx  
 mov         rdi,rdx  
 xor         eax,eax  
            if (typeof(TFeature) == typeof(IHttpRequestFeature))
 mov         rbx,qword ptr [rdi+10h]  
 mov         rcx,qword ptr [rbx]  
 mov         rdx,7FFC4D653D90h  
 cmp         rcx,rdx  
 jne         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03Bh (07FFC4D6CD0EBh)  
            {
                feature = (TFeature?)_currentIHttpRequestFeature;
 mov         rdx,qword ptr [rsi+140h]  
 call        Method stub for: System.Runtime.CompilerServices.CastHelpers.ChkCastAny(Void*, System.Object) (07FFC4CC04898h)  
 jmp         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03B4h (07FFC4D6CD464h)  
            }
            else if (typeof(TFeature) == typeof(IHttpRequestBodyDetectionFeature))
 mov         rdx,7FFC4D653EB8h  
 cmp         rcx,rdx  
 jne         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+05Bh (07FFC4D6CD10Bh)  
            {
                feature = (TFeature?)_currentIHttpRequestBodyDetectionFeature;
 mov         rdx,qword ptr [rsi+148h]  
 call        Method stub for: System.Runtime.CompilerServices.CastHelpers.ChkCastAny(Void*, System.Object) (07FFC4CC04898h)  
 jmp         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03B4h (07FFC4D6CD464h)  
            }
            else if (typeof(TFeature) == typeof(IHttpResponseFeature))
 mov         rdx,7FFC4D653FE8h  
 cmp         rcx,rdx  
 jne         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+07Bh (07FFC4D6CD12Bh)  
            {
                feature = (TFeature?)_currentIHttpResponseFeature;
 mov         rdx,qword ptr [rsi+150h]  
 call        Method stub for: System.Runtime.CompilerServices.CastHelpers.ChkCastAny(Void*, System.Object) (07FFC4CC04898h)  
 jmp         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03B4h (07FFC4D6CD464h)  
            }

@benaadams
Copy link
Member Author

Workaround is to use Unsafe.As<IInterface, TFeature>() which drops the ChkCastAny

TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
{
    TFeature? feature = default;
    if (typeof(TFeature) == typeof(IHttpRequestFeature))
    {
        feature = Unsafe.As<IHttpRequestFeature?, TFeature?>(ref _currentIHttpRequestFeature);
    }
    else if (typeof(TFeature) == typeof(IHttpRequestBodyDetectionFeature))
    {
        feature = Unsafe.As<IHttpRequestBodyDetectionFeature?, TFeature?>(ref _currentIHttpRequestBodyDetectionFeature);
    }
    else if (typeof(TFeature) == typeof(IHttpResponseFeature))
    {
        feature = Unsafe.As<IHttpResponseFeature?, TFeature?>(ref _currentIHttpResponseFeature);
    }
    else if (typeof(TFeature) == typeof(IHttpResponseBodyFeature))
    {
        feature = Unsafe.As<IHttpResponseBodyFeature?, TFeature?>(ref _currentIHttpResponseBodyFeature);
    }
    else if (typeof(TFeature) == typeof(IRequestBodyPipeFeature))
    {
        feature = Unsafe.As<IRequestBodyPipeFeature?, TFeature?>(ref _currentIRequestBodyPipeFeature);
    }
       TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
        {
            TFeature? feature = default;
 push        rbx  
 sub         rsp,30h  
 mov         qword ptr [rsp+28h],rdx  
 mov         rsi,rcx  
 mov         rdi,rdx  
 xor         eax,eax  
            if (typeof(TFeature) == typeof(IHttpRequestFeature))
 mov         rbx,qword ptr [rdi+10h]  
 mov         rcx,qword ptr [rbx]  
 mov         rdx,7FFC4D691780h  
 cmp         rcx,rdx  
 jne         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03Bh (07FFC4D705DFBh)  
            {
                feature = Unsafe.As<IHttpRequestFeature?, TFeature?>(ref _currentIHttpRequestFeature);
 cmp         dword ptr [rsi],esi  
 lea         rax,[rsi+140h]  
 mov         rax,qword ptr [rax]  
 jmp         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03B4h (07FFC4D706174h)  
            }
            else if (typeof(TFeature) == typeof(IHttpRequestBodyDetectionFeature))
 mov         rdx,7FFC4D6918A8h  
 cmp         rcx,rdx  
 jne         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+05Bh (07FFC4D705E1Bh)  
            {
                feature = Unsafe.As<IHttpRequestBodyDetectionFeature?, TFeature?>(ref _currentIHttpRequestBodyDetectionFeature);
 cmp         dword ptr [rsi],esi  
 lea         rax,[rsi+148h]  
 mov         rax,qword ptr [rax]  
 jmp         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03B4h (07FFC4D706174h)  
            }
            else if (typeof(TFeature) == typeof(IHttpResponseFeature))
 mov         rdx,7FFC4D6919D8h  
 cmp         rcx,rdx  
 jne         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+07Bh (07FFC4D705E3Bh)  
            {
                feature = Unsafe.As<IHttpResponseFeature?, TFeature?>(ref _currentIHttpResponseFeature);
 cmp         dword ptr [rsi],esi  
 lea         rax,[rsi+150h]  
 mov         rax,qword ptr [rax]  
 jmp         Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.Microsoft.AspNetCore.Http.Features.IFeatureCollection.Get[[System.__Canon, System.Private.CoreLib]]()+03B4h (07FFC4D706174h)  
            }

benaadams added a commit to benaadams/AspNetCore that referenced this issue Mar 28, 2021
davidfowl pushed a commit to dotnet/aspnetcore that referenced this issue Mar 29, 2021
- Use strongly typed features
- Use Unsafe.As to workaround dotnet/runtime#49614
- Do the casting it for Set<T> as well
- Add more benchmarks
- Reorder features (order of reset);
eugene2candy added a commit to eugene2candy/Home that referenced this issue Apr 10, 2021
* Update dependencies from https://github.com/dotnet/efcore build 20210315.3 (dotnet#30960)

[main] Update dependencies from dotnet/efcore

* Feedback from Pranav

* Remove regex use in DataProtection (dotnet#30855)

* Fix null ref in SyntaxTokenCache (dotnet#30978)

Fixes dotnet#27154

* Pool SocketSenders (dotnet#30771)

- SocketAsyncEventArgs have lots of state on them and as a result are quite big (~350) bytes at runtime. We can pool these since sends are usually very fast and we can reduce the per connection overhead as a result.
- We also allocate one per IOQueue to reduce contention.
- Fixed buffer list management
- Disposed pool when the transport is disposed
- Added project to slnf so running tests in VS was possible
- Clear the buffer and buffer list before returning to the pool
- This cleans up dumps as the pooled senders don't see references to buffers
while pooled in the queue
- Keep track of items in the pool separately from the queue count.

* Add Consolidated view classifier to make view types internal (dotnet#30976)

* Add Consolidated view classifier to make view types internal

* Address feedback from peer review

* Address feedback and fix tests

* Fix nullability of TypeNameHelper.GetTypeDisplayName parameter (dotnet#30987)

* [main] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#30968)

[main] Update dependencies from dotnet/runtime dotnet/efcore


 - Remove assemblies from the ref and runtime pack

 - Remove more references

* Update src/Features/JsonPatch/src/Internal/ConversionResultProvider.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update src/Features/JsonPatch/src/PublicAPI.Unshipped.txt

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update dependencies from https://github.com/dotnet/efcore build 20210316.2 (dotnet#30991)

[main] Update dependencies from dotnet/efcore

* HTTP/3 input validation and connection abort (dotnet#29665)

* Connection error for invalid HTTP/3 frame on request stream

* Update src/Servers/Kestrel/Core/src/CoreStrings.resx

* Write frame types and errors codes in logs as per spec

* Clean up

* Add HTTP/3 connection exception with code

* Connection abort

* More abort connection stuff

* More test

* More tests

* PR feedback

* Update dependencies from https://github.com/dotnet/efcore build 20210317.1 (dotnet#30998)

[main] Update dependencies from dotnet/efcore

* helix + pw + linux/osx (dotnet#30676)

* [main] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#30999)

[main] Update dependencies from dotnet/runtime dotnet/efcore

* Dispose streams that don't fit in pool (dotnet#30995)

* Dispose streams that don't fit in pool

* PR feedback

* Update NodeJS dependency in build instructions (dotnet#31000)

* Respect consolidated views in all document classifiers (dotnet#31008)

* Respect consolidated views in all document classifiers

* Address feedback from peer review

* E2E test apps for WinForms and WPF BlazorWebView (dotnet#31021)

* Add API to Renderer to trigger a UI refresh on hot reload (dotnet#30884)

* Add API to Renderer to trigger a UI refresh on hot reload

Fixes dotnet#30816

* Update RazorExtensions.cs (dotnet#31029)

* Fix credscan issues in aspnetcore (dotnet#30337)

* Fix credscan issues in DataProtection

* Fix credscan issues in Identity, except where they affect checked in certs

* Updated scan

* [Blazor] Adds static web assets support for Blazor desktop (dotnet#31041)

* Wires up static web assets support on the WebViewManager.

* Support ElementReference.Focus in WebView (dotnet#31050)

* Support InputFile in WebView (dotnet#31049)

* Update DotNetMuxerTest (dotnet#31053)

Fixes dotnet#24082

* Bring back working DevServer packaging setup (dotnet#31043)

* Bring pack working DevServer packaging setup

* Revert "Bring pack working DevServer packaging setup"

This reverts commit 0dda92e.

* Update runtimeconfig.template.json

* Quarantine one failing test (dotnet#31045)

- dotnet#31044
- `RazorPagesTemplate_RazorRuntimeCompilation_BuildsAndPublishes()`

* Update SDK to bring unified assembly changes (dotnet#31039)

* Update SDK to bring unified assembly changes

* Update SDK to pick up Razor pages fix

* Fixup test

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Update launchSettings to indicate hotReload is to be used (dotnet#31060)

* Fix race in FrameAfterTrailers_UnexpectedFrameError dotnet#30754 (dotnet#31061)

* Fix JS interop cases in WebView (dotnet#31054)

* Template tests: Create dev cert only once (dotnet#31012)

* Simplify Razor bug reports. (dotnet#31033)

* Simplify Razor bug reports.

- We now have better mechanisms for capturing information so no need to scare users off.

* Address code review feedback

* [Blazor][Desktop] Mark packages as shipping (dotnet#31035)

* Make packages shipping
* Update RepoTasks to msbuild 16.9
* Update global.json
* Update Nuget

* Remove WebView dependency to AspNetCore.App (dotnet#31071)

The Blazor Desktop project must not depend on Microsoft.AspNetCore.App because it needs to run on almost any platform, including Android/iOS. But AspNetCore.App doesn't run on those platforms. This changes WebView to not use any packages that are part of AspNetCore.App, such as StaticFiles and Http.Abstractions. Instead, it has copies of those files.

* Use longer delay in test (dotnet#31072)

* [SignalR TS] Fix permanent Disconnecting state (dotnet#30948)

* Changed logLevel to Information instead of warning for EphemeralDataProtectionProvider (dotnet#29405)

Fixes dotnet#29107

* [Blazor][Desktop] Fixes nullable annotations on the public API baselines (dotnet#31073)

* Fix nullable annotations
* Fix APIs
* Add missing API baseline file

* Implements shadow copying for ASP.NET Core + IIS (dotnet#28357)

* Suppress generating source checksums when configured (dotnet#31089)

Hot reload / EnC does not like it when type level attributes are modified. Razor views and Pages
include a RazorSourceChecksumAttribute that includes a checksum of all of it's inputs (current cshtml file, and
all _ViewImports that contribute to it). It's used used by runtime compilation to tell if the compiled view is
current compared to it's inputs. However, it gets in the way with enc since editing a file updates the checksum.

We'll disable this feature by default in RazorSourceGenerator, and enable it using an MSBuild switch that's configured
by runtime compilation

* Caching Redis: Add option to register profiling session (dotnet#31018)

* Add option to register profiling session

* Add API change

* Fix public API declaration

* Cleanup

* Quarantine and fix RequestTrailers_CanReadTrailersFromRequest dotnet#31057 (dotnet#31059)

* Sync shared code from runtime (dotnet#31094)

Co-authored-by: Tratcher <Tratcher@users.noreply.github.com>

* Revert "Remove ANCM shim and outofprocess handler from Runtime SiteEx… (dotnet#31042)

* Revert "Remove ANCM shim and outofprocess handler from Runtime SiteExtension (dotnet#24884)"

This reverts commit 7f7528f.

* Enable site extension build temporarily

* Enable build native

* Fixing site extension build

* No need to set

* Fixing up build

* Update .azure/pipelines/ci.yml

* Update ci.yml

* retry

* Update .azure/pipelines/ci.yml

* Follow ups for Blazor AOT (dotnet#31098)

* Follow ups for Blazor AOT

* Add Emscripten packs to manifest
* Update acquire tool to use manifest from the dotnet sdk
* Add AOT option to templates

* Undo Emscripten for now

* [Blazor] [Desktop] Exclude Resources.resx from the embedded file manifest (dotnet#31107)

Excludes unnecessary embedded resources from the embedded files manifest provider.

* Fix some low hanging allocation fruit (dotnet#31115)

* Fix some low hanging allocation fruit
- Use singleton pipe options
- Use Task.Yield instead of AwaitableThreadPool on the server side
- Change WebSocketMiddleware handshake helpers to remove enumerator allocations.

* Fix issues preventing hot reload for Blazor WASM (dotnet#31108)

* Configure DOTNET_MODIFIABLE_ASSEMBLIES=debug env variable
* Fixup broken reflection

* Fixup targeting pack intermediate zip version

* Add new Polly DI extension method for HttpClientFactory (dotnet#28283)

* Fix IDE warnings

Fix IDE warnings about non-disposed handlers.

* Update return type documentation

Update the comment's type to match the method's.

* Add new AddPolicyRegistry overload

Add a new overload for AddPolicyRegistry() that allows the
caller to configure the policy registry using other services
that are registered with the service provider, such as config.

* Add more nullability to Mvc.Core (dotnet#31076)

* Update nuget & msbuild versions (dotnet#31064)

* Update nuget & msbuild versions

* Update RepoTasks.csproj

* Fix one test

* Fix all tests

* Update dependencies from https://github.com/dotnet/arcade build 20210317.3 (dotnet#31124)

Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk , Microsoft.DotNet.Helix.Sdk
 From Version 6.0.0-beta.21160.7 -> To Version 6.0.0-beta.21167.3

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>

* Update branding to 6.0.0-preview4

* Revert "Update branding to 6.0.0-preview4"

This reverts commit 5c8e9f1.

* Added missing event ids for hosting events (dotnet#31149)

- Fixed slnf file

* Don't separately build arm64 installers

* Don't build targeting pack nupkgs

* Undo change that stopped building installers in win-arm64 leg.

This reverts commit 03aab5d.

* Update comment

* Update branding to 6.0.0-preview4 (dotnet#31153)

* Dispose the DiagnosticListener (dotnet#31170)

- Add the DiagnosticListener to the DI container as a lambda so it gets disposed.

* Add support for tabs vs. spaces settings for generated files

* Fixed grammar on `SessionOptions.IOTimeout` XML (dotnet#31174)

Fixed grammar on `SessionOptions.IOTimeout`

* Resolve remaining credscan bugs (dotnet#31157)

* Default to Kestrel over IISExpress (dotnet#31161)

* Update CONTRIBUTING.md (dotnet#31167)

* Update CONTRIBUTING.md

* Follow-up edits

* Add tracing to templates process launch for debugging (dotnet#31202)

* Add tests

* Cleanup

* Cleanup

* Remove unsafe from BytesOrdinalEqualsStringAndAscii (dotnet#31201)

* Add field

* Cleanup

* Revert changes to global.json

* fix naming

* Add hotReloadProfile to Razor Pages template (dotnet#31197)

* BlazorTemplate test improvements (dotnet#30907)

* Split the HPackEncoder partial class (dotnet#31210)

* [main] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#31020)

[main] Update dependencies from dotnet/runtime dotnet/efcore


 - Do not declare iOS and Android support everywhere
- runtime update includes new annotations making non-support obvious
- see dotnet/runtime#49354 (w/ a similar Android PR coming soon)

 - !fixup! Fix typo in item group name

 - !fixup! Set `$(RemoveDevicePlatformSupport)` in correct project
- not needed in BlazorManifest.csproj
- but, is needed in dotnet-install-blazoraot.csproj

 - suppress

 - Fixup

* Annotate Blazor wasm auth assemblies for trimmability (dotnet#31119)

Minor cleanup when inspecting the code

* Creates script command for sql-cache-tool (dotnet#30398)

* Creates script command for sql-cache-tool
* Includes idempotency, output to stdout, or specific file
* Fixes help suggestion to be command-specific

* Corrects typo

* Revert "BlazorTemplate test improvements (dotnet#30907)" (dotnet#31223)

This reverts commit 730e39b.

* Sync shared code from runtime (dotnet#31182)

Co-authored-by: dotnet <dotnet@users.noreply.github.com>

* Unquarantine BootResourceCachingTest (dotnet#31154)

* Resolve final credscan bug (dotnet#31196)

* READMEs for Servers (dotnet#31207)

* READMEs for Servers

* Remove en-us

* Update src/Servers/README.md

Co-authored-by: Brennan <brecon@microsoft.com>

* Update src/Servers/Kestrel/README.md

Co-authored-by: Chris Ross <Tratcher@Outlook.com>

* Update src/Servers/IIS/README.md

Co-authored-by: Chris Ross <Tratcher@Outlook.com>

* Feedback

* Update src/Servers/HttpSys/README.md

* Quick test

* HttpSys

* Update README.md

* Feedback

* Update src/Servers/IIS/README.md

Co-authored-by: Günther Foidl <gue@korporal.at>

* Update src/Servers/Kestrel/README.md

Co-authored-by: Günther Foidl <gue@korporal.at>

Co-authored-by: Brennan <brecon@microsoft.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Günther Foidl <gue@korporal.at>

* Components test parole for good behavior (dotnet#31156)

* Add hotReloadProfile to Razor Pages template (dotnet#31216)

* Add hotReloadProfile to Razor Pages template

* Turn off hotReloadProfile for Blazor WebAssembly projects

The WebAssembly experience is a bit problematic in preview3 because of runtime issues
dotnet/runtime#50190. We'll turn it off in the templates by default
to avoid giving a confusing experience out of the box.

* [main] Update dependencies from dotnet/efcore dotnet/runtime (dotnet#31220)

[main] Update dependencies from dotnet/efcore dotnet/runtime

* Readmes for HTTP and Site Extensions (dotnet#31250)

* Readmes for HTTP and Site Extensions

* Apply suggestions from code review

Co-authored-by: Brennan <brecon@microsoft.com>

Co-authored-by: Brennan <brecon@microsoft.com>

* Update dependencies from https://github.com/dotnet/efcore build 20210325.2 (dotnet#31254)

[main] Update dependencies from dotnet/efcore

* Refactor and fix failing tests

* Revert global.json changes

* Enable CA2012 (Use ValueTask Correctly) (dotnet#31221)

* Unquarantine a couple servers tests (dotnet#31213)

* Update src/Razor/Microsoft.AspNetCore.Razor.Language/src/CodeGeneration/CodeWriter.cs

Co-authored-by: Pranav K <prkrishn@hotmail.com>

* Sync shared code from runtime (dotnet#31271)

Co-authored-by: Tratcher <Tratcher@users.noreply.github.com>

* Update dependencies from https://github.com/dotnet/runtime build 20210326.1 (dotnet#31277)

[main] Update dependencies from dotnet/runtime

* Use Emscripten SDKs in WASM workload (dotnet#31259)

* Update dependencies from https://github.com/dotnet/efcore build 20210326.1 (dotnet#31283)

[main] Update dependencies from dotnet/efcore

* Clean up verbiage on build scripts (dotnet#31262)

* Clean up verbiage on build scripts

* Update docs/BuildFromSource.md

Co-authored-by: Kevin Pilch <kevinpi@microsoft.com>

Co-authored-by: Kevin Pilch <kevinpi@microsoft.com>

* Enable nullable on more authentication projects (dotnet#31230)

* Enable nullable on Azure projects (dotnet#31298)

* Reduce allocations for Cookies. (dotnet#31258)

* Update dependencies from https://github.com/dotnet/efcore build 20210326.2 (dotnet#31292)

[main] Update dependencies from dotnet/efcore

* [release/6.0-preview3] Update dependencies from dotnet/efcore dotnet/runtime (dotnet#31255)

[release/6.0-preview3] Update dependencies from dotnet/efcore dotnet/runtime


 - Port changes from main

 - Merge branch 'release/6.0-preview3' into darc-release/6.0-preview3-ce4fb228-ea32-4f60-95e1-0e60d42e3fc3

* [main] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#31310)

[main] Update dependencies from dotnet/runtime dotnet/efcore

* Update dependencies from https://github.com/dotnet/runtime build 20210327.4 (dotnet#31329)

[main] Update dependencies from dotnet/runtime

* Fix comment grammar (dotnet#31326)

Minor update to XML docs to fix sentence grammar.

* Use LoggerMessage.Define in HttpSys (dotnet#31333)

- Use LoggerMessage.Define() throughout HttpSys instead of ILogger extension methods.
- Also updates two incorrect event Id field names.

Fixes dotnet#31313.

* Reduce the per connection overhead in SocketConnection (dotnet#31308)

* Reduce the per connection overhead in SocketConnection
- Removed 3 state machines (StartAsync, ProcessSends and ProcessReceives)
- Use ValueTask to remove delegate allocation on both senders and receivers
- Remove field from DoSend and DoReceive state machine

* Faster strongly typed features for server FeatureCollection (dotnet#31322)

- Use strongly typed features
- Use Unsafe.As to workaround dotnet/runtime#49614
- Do the casting it for Set<T> as well
- Add more benchmarks
- Reorder features (order of reset);

* Update dependencies from https://github.com/dotnet/runtime build 20210328.6 (dotnet#31350)

[main] Update dependencies from dotnet/runtime

* Move logging to separate class to prevent allocation per generic type (dotnet#31345)

* Badges, badges! (Licence, Help wanted, Good first issue, Chat) (dotnet#31341)

* Badges, badges! (Licence, Help wanted, Good first issue, Chat)

* Use correct links

* Update dependencies from https://github.com/dotnet/efcore build 20210329.1 (dotnet#31351)

[main] Update dependencies from dotnet/efcore

* Fix WebView header APIs and behavior (dotnet#31246)

* Fix WebView header APIs and behavior
- Change WebView to return dictionary of headers instead of strings (this is needed for Android)
- Change StaticContentProvider to use filename (always exists) instead of physical file path (not always available) to determine MIME type
- Fix WPF sample bug

* Update dependencies from https://github.com/dotnet/efcore build 20210329.2 (dotnet#31352)

[main] Update dependencies from dotnet/efcore

* Update dependencies from https://github.com/dotnet/efcore build 20210327.1 (dotnet#31309)

[release/6.0-preview3] Update dependencies from dotnet/efcore

* Update dependencies from https://github.com/dotnet/runtime build 20210329.3 (dotnet#31363)

[release/6.0-preview3] Update dependencies from dotnet/runtime

* Refactor logging in generic classes (dotnet#31364)

* Update dependencies from https://github.com/dotnet/efcore build 20210329.4 (dotnet#31366)

[release/6.0-preview3] Update dependencies from dotnet/efcore

* Update dependencies from https://github.com/dotnet/efcore build 20210329.3 (dotnet#31353)

[main] Update dependencies from dotnet/efcore

* Make RequestDelegateFactory public (was MapActionExpressionTreeBuilder) (dotnet#31171)

* Make RequestDelegateBuilder public

- Formerly known as MapActionExpressionTreeBuilder

* Add new BuildRequestDelegate overloads

* Address PR feedback

* RequestDelegateBuilder -> RequestDelegateFactory

* Build -> Create

* Address final review feedback.

* [Http] Remove some unsafe code and save a string allocation (dotnet#31267)

* Use one shot pbkdf2 (dotnet#31200)

* Use one shot pbkdf2

* Update NetCorePbkdf2Provider.cs

* CR feedback

* CR feedback

* Fix

* Just use GetBytes for now

* Update NetCorePbkdf2Provider.cs

* Use interned Header Names for known headers not in the pre-allocated block (dotnet#31311)

* Use interned headernames for known headers not in the preallocated block

* Switch Connection header values for interned values

* Use interned strings for websockets

* Keep baggage, tracestate, and traceparent with previous casing

* Update src/Servers/Kestrel/shared/KnownHeaders.cs

Co-authored-by: Chris Ross <Tratcher@Outlook.com>

* Feedback

Co-authored-by: Chris Ross <Tratcher@Outlook.com>

* Revert global.json changes

* Modify constructor

* Remove IReceiveHotReloadContext and HotReloadContext (dotnet#31281)

* Remove IReceiveHotReloadContext and HotReloadContext

React to API review feedback. Substitute IReceiveHotReloadContext and HotReloadContext
with RenderHandle.IsHotReloading

* Fixup

* Update src/Components/Components/src/RenderHandle.cs

* Update src/Components/Components/src/Properties/ILLink.Substitutions.xml

* Update src/Components/Components/src/Properties/ILLink.Substitutions.xml

* Flow Kestrel CancellationTokens to BindAsync (dotnet#31377)

* Update dependencies from https://github.com/dotnet/runtime build 20210329.5 (dotnet#31384)

[main] Update dependencies from dotnet/runtime

* [main] Update dependencies from dotnet/arcade (dotnet#31349)

[main] Update dependencies from dotnet/arcade

* Quarantine flaky test (dotnet#31389)

* Clean up NetCore PBKDF2 provider. (dotnet#31391)

* Update dependencies from https://github.com/dotnet/runtime build 20210330.7 (dotnet#31394)

[release/6.0-preview3] Update dependencies from dotnet/runtime

* Add a FeaturesCollection constructor that supports initial capacity (dotnet#31381)

* Add a FeaturesCollection constructor that supports initial capacity

* Raise authenticationFailed event when cert validation fails (dotnet#31370)

* Unquarantine UseStartupFactoryWorks (dotnet#31297)

* Update dependencies from https://github.com/dotnet/efcore build 20210330.1 (dotnet#31400)

[release/6.0-preview3] Update dependencies from dotnet/efcore

* Update dependencies from https://github.com/dotnet/efcore build 20210330.2 (dotnet#31401)

[main] Update dependencies from dotnet/efcore

* Fix generated CSS scopes in layout views and update templates (dotnet#31257)

* Fix generated CSS scopes in layout views and update templates

* Update template baselines

* Enabled scoped CSS for MVC template tests

* Bring back static CSS file

* Quarantine ClosesAfterDataSent (dotnet#31405)

* Update CONTRIBUTING.md (dotnet#31371)

Removed tab that seemed to cause a paragraph about the new help wanted label to be in a code fence.

* Support round trip serialization of AuthenticationProperties with System.Text.Json (dotnet#31330) dotnet#20722

* Update Microsoft.Net.Compilers.Toolset (dotnet#31403)

* Improve test failures for unexpected logs (dotnet#31406)

* Add ToString() to Testing's log WriteContext

* Update StrictTestServerTests to only show unexpected log

* Undo template change that induced flakiness (dotnet#31417)

* Add helpful exception message when exception handler returns 404 (dotnet#31142)

* Update dependencies from https://github.com/dotnet/runtime build 20210331.6 (dotnet#31421)

[release/6.0-preview3] Update dependencies from dotnet/runtime

* Do not serialize Parameters property on AuthenticationProperties (dotnet#31414)

* Do not serialize Parameters

Explicitly prevent the Parameters dictionary from being included in the deserialized payload.
See dotnet#31330 (comment).

* Ignore props backed by Items

Also ignore the properties backed by the Items dictionary to minimise the size of the serialized JSON payload.

* Add ignoreLineEndingDifferences

Stop tests from failing on non-Windows OSs due to different line endings.

* ArPow stage 1: local source-build infrastructure (dotnet#31235)

Conflicts:
	eng/Version.Details.xml

Co-authored-by: John Luo <johluo@microsoft.com>

* [main] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#31411)

[main] Update dependencies from dotnet/runtime dotnet/efcore

* Update dependencies from https://github.com/dotnet/efcore build 20210331.4 (dotnet#31424)

[release/6.0-preview3] Update dependencies from dotnet/efcore

* Fix project path in slnf (dotnet#31431)

* Fix trailing comma in Caching.slnf (dotnet#31438)

* Fix file headers in src/Caching (dotnet#31439)

* [SignalR Java] Update to RxJava3 (dotnet#31426)

* Fixed de-duping hosting startup assemblies (dotnet#31440)

- De-dupe hosting startup assemblies based on assembly instance not the name of the assembly. Names can be short or long and we don't know if they resolve to the same assembly. Instead of trying to mess with names, we just check to make sure that the instance isn't the same.

* Trim down framework references for Blazor dev server (dotnet#31420)

* Only include Microsoft.AspNetCore.App framework reference for Blazor dev server
* Address feedback from peer review
* Use SharedFxVersion property

* Cross-target last few projects to DefaultNetCoreTargetFramework (dotnet#31239)

* Cross-target last 2 projects to DefaultNetCoreTargetFramework

* More projects

* Fixup

* Fixup again

* Fixup

* Undo SiteExtension change

* Update src/SiteExtensions/LoggingBranch/LB.csproj

Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>

Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>

* [main] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#31425)

[main] Update dependencies from dotnet/runtime dotnet/efcore

* Use integer division trick to get exact base64 length (dotnet#31442)

* Add nullability to more MVC assemblies (dotnet#31338)

* Add nullability to more MVC assemblies

* [x] MVC.Cors
* [x] Mvc.DataAnnotations
* [x] Mvc.Localization
* [x] Mvc.Newtonsoft.Json
* [ ] Mvc.ViewFeatures (partial)

* Fixup

* Update src/Mvc/Mvc.ViewFeatures/src/Rendering/ViewContext.cs

* Apply suggestions from code review

* Update RazorPagePropertyActivator.cs

* Update assembly check on EventHandlerTagHelperDescriptorProvider (dotnet#31458)

* Remove legacy routing (dotnet#31295)

* [release/6.0-preview3] Update dependencies from dotnet/runtime dotnet/efcore (dotnet#31451)

[release/6.0-preview3] Update dependencies from dotnet/runtime dotnet/efcore

* Update dependencies from https://github.com/dotnet/arcade build 20210331.6 (dotnet#31427)

[main] Update dependencies from dotnet/arcade


 - Merge branch 'main' into darc-main-2c400715-e553-48d8-8d43-983dc7aa4b7d

* Update dependencies from https://github.com/dotnet/efcore build 20210401.3 (dotnet#31468)

[main] Update dependencies from dotnet/efcore

* Fix project paths in Azure.slnf (dotnet#31435)

* Fix project paths in Azure.slnf

* Update Azure.slnf

* Update IdentityModel versions to 6.10.0 dotnet#31454 (dotnet#31482)

* Removed static activity source from hosting (dotnet#31483)

* Removed static activity source from hosting
- Get it from DI instead

* Fixed test

* Use Random.Shared property (dotnet#31453)

* Use Random.Shared

Use the new .NET 6 Random.Shared static property where possible.
See dotnet/runtime#50297.

* Revert WebApi-CSharp changes

For some reason I don't understand, this template doesn't see Random.Shared when compiled so this reverts the previous change for this template.

* Remove baseline suppressions from 5.0 (dotnet#29934)

* Remove baseline suppressions from 5.0

* Use newer NuGet.Protocol version

- v4.8.2 ➡️  v5.8.1

* Fix condition

* Back to 5.8.1

* Undo components changes

* Whoops

* Whoops

Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>

* Remove DNT from pre-reserved headers (dotnet#31493)

No modern browser uses it anymore

* Reuse HttpProtocol CTS (dotnet#31466)

* Change Router _emptyParametersDictionary to a regular Dictionary (dotnet#31460)

* Change Router _emptyParametersDictionary to a regular Dictionary

This allows for ReadOnlyDictionary to be trimmed in a default Blazor WASM app. Saving roughly 3 KB .br compressed.

Contributes to dotnet#30098

* Update src/Components/Components/src/Routing/Router.cs

Co-authored-by: James Newton-King <james@newtonking.com>

* Clean up some MVC code (dotnet#31511)

* Clean up some MVC code

* PR feedback

* Do not throwing on InputBase.Dispose() if not in EditContext. (dotnet#31510)

* Do not throwing on InputBase.Dispose() if not in EditContext.

Fixes dotnet#30990

* Cache filters between requests in the ordinary case (dotnet#31513)

In the normal case,
* only the DefaultFilterFactoryProvider is registered
* all filters registered by the framework are reusable

We could so something targeted and cache filter instances between requests.

* Update dependencies from https://github.com/dotnet/arcade build 20210403.1 (dotnet#31526)

[main] Update dependencies from dotnet/arcade

* Flaky tests (dotnet#31502)

* Revert "Update assembly check on EventHandlerTagHelperDescriptorProvider (dotnet#31458)" (dotnet#31530)

This reverts commit 7bc87ba.

* Ability to deactivate DataAnnotationsValidation dynamically. Fixes dotnet#31027 (dotnet#31413)

* Use UriHelper.BuildAbsolute for RedirectToHttpsRule (dotnet#28899)

* Use UriHelper.BuildAbsolute and UriHelper.BuildRelative for RedirectRule (dotnet#28903)

* Still send 100 Continue with null MinRequestBodyDataRate (dotnet#31543)

* Update Selenium/Playwright (dotnet#31497)

* Update Selenium/Playwright

* Update selenium-config.json

* Update Versions.props

* Added VSCode debugging (for MvcSandbox) & code analysis support  (dotnet#29486)

* Added VSCode debugging support for MvcSandbox

* Added ignored vscode folders

* 1. Convered some more projects.
2. Added env variable for TargetFramework and used it in launch.json file rather than
hardcoding TFW.

* Addressed PR feedback.
1. Removed extensions.json
2. Updated BuildFromSource.md for Vscode instructions.
3. Added launch settings for BasicTestApp.

* Addressed PR feedback!

* Implement new SmallCapacityDictionary for dictionaries with a small amount of values. (dotnet#31360)

* Fix duplicated event names in KestrelTrace logger. (dotnet#31523) (dotnet#31554)

* Update area-owners.md (dotnet#31552)

* Data Protection minor tidying (dotnet#31512)

* Remove unused code

Remove unused constant, method and variable.

* Remove array allocations

Use Array.Empty() instead of allocating an empty array.
Use a static array for activation type instead of creating a new one per invocation.

* Rename field

Address PR feedback.

* [SignalR TS] Improve connection error messages (dotnet#31402)

* [MVC] Fix MSB4186 error (dotnet#31066)

Fix MSB4186 error if a project references Microsoft.AspNetCore.Mvc.Testing that is not itself an ASP.NET project, such as a helper library in a test suite.

* Re-use cancellation tokens in the https middleware (dotnet#31528)

* Re-use cancellation tokens in the https middleware
- These tokens are usually short lived and exist for the purposes of cancelling the handshake.

* Fix IPNetwork.Contains behavior for prefixes which are not at start of subnet range (dotnet#31573)

* Update branding to 5.0.6 (dotnet#31563)

* Use skipEnabledCheck for LoggerMessage.Define (dotnet#31562)

* Use skipEnabledCheck in MVC

* Use skipEnabledCheck in Http/Routing DefaultLinkGenerator, DefaultLinkParser, and DfaMatcher

* Use skipEnabledCheck in SignalR

* Use skipEnabledCheck in Components

* Use skipEnabledCheck in Hosting

* Use skipEnabledCheck in Servers/HttpSys

* Use skipEnabledCheck in Servers/Kestrel

* Use skipEnabledCheck in Middleware

* Avoid some allocations by checked IsEnabled first in MVC

* Avoid some allocations by checked IsEnabled first in Servers/Kestrel

* Simplify usage of logging in transports

* Fix up typo in Blazor Server launchSettings.json (dotnet#31580)

* Rename 'Blazor component' to 'component' to be more generic (dotnet#31590)

Co-authored-by: Adrian Wright <adrian@compiledcoding.co.uk>

* Update branding to 3.1.15 (dotnet#31577)

* Update branding to 3.1.15

Update Ubuntu 16.04 to 18.04

* Remove obsolete groovy code

* [release/5.0] Update nuget versions (dotnet#31490)

* Update nuget/msbuild versions

* Update nuget

* Nuget only

* Fix baseline, update to 5.8.1

* Undo test change

* Update MetadataSerializerTest.cs

* Set cab name for TargetingPack.wixproj (dotnet#30975)

* Added IConnectionSocketFeature  (dotnet#31588)

- Removed the nullable from the Socket property as approved in API review
- Make the IConnectionSocketFeature an additional feature instead of one implemented on the TransportConnection.
- Added a test to verify it works

* Fix null ref in SyntaxTokenCache (dotnet#30978) (dotnet#30988)

Fixes dotnet#27154

* Still send 100 Continue with null MinRequestBodyDataRate (dotnet#31568)

* [SignalR TS] Fix permanent Disconnecting state (dotnet#30948) (dotnet#31253)

* Fix arguments order for call of HeartbeatSlow (dotnet#28698) (dotnet#31080)

Co-authored-by: Roman Marusyk <Marusyk@users.noreply.github.com>

* Quarantine one failing test (dotnet#31045) (dotnet#31296)

- dotnet#31044
- `RazorPagesTemplate_RazorRuntimeCompilation_BuildsAndPublishes()`

Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>

* Fix merge

* Fix merge

* Update HubConnection.Reconnect.test.ts

* Update default-build.yml

* Error boundaries (dotnet#30874)

* Remove unused ADAL dependency (dotnet#31484)

* Remove unused dependency

* Remove outdated AAD sample

* Custom event args: support receiving IJSObjectReference (dotnet#31591)

* Add failing E2E case

* Implement fix

* Add E2E test

* Update src/Components/test/testassets/BasicTestApp/EventCustomArgsComponent.razor

* Update suppressions

* [SignalR TS] Set keep alive timer in receive loop (dotnet#31300)

* Unskip some fixed E2E tests (dotnet#31614)

* Fix "no event handler" in simultaneous blur+removal case (dotnet#31612)

* [SPA] Introduces new approach for proxying the SPA templates (dotnet#31564)

* A new package Microsoft.AspNetCore.SpaProxy has been added that is
  used by the templates to launch their development proxy via npm/yarn.
* The SPA development proxy for each CLI now is the frontend for the
  application and proxies the requests to the backend which is the
  ASP.NET Core application.
* At publish time the application assets are copied to the wwwroot.
* SpaServices.Extensions has been removed from the templates since it is
  no longer needed. MapFallbackToFile("index.html") handles unknown
  requests and serves the SPA entry point.
* The templates have been updated to keep using HTTPS with the SPA proxy
  configured to use the ASP.NET Core HTTPS development certificate via a
  new aspnetcore-https.js file that ships within the template.
* The configuration for angular has been updated with a proxy.conf.js
  file to proxy requests to the backend.
* The entry point for the application in development is now
  https://localhost:5002 when using https and http://localhost:5002
  otherwise.

* Infer default sources for parameters of minimal actions (dotnet#31603)

This does a big chunk of dotnet#30248 while heavily refactoring the RequestDelegateFactory by splitting it out into a bunch of smaller methods.

For part 2 of dotnet#30248, a "scalar value type that lives in the System namespace", I went with the alternative of "Something convention-based like the presence of a bool TryParse(string, out T) method" instead. This conventions work for types in any namespace including user-defined types.

* Avoid closure caused by local function (dotnet#31641)

* Avoid closure caused by local function
- Made the local function static and passed state via parameters.

* Remove form support from minimal APIs (dotnet#31646)

* Remove form support from minimal APIs

* Add

* MapActionSample -> MinimalSample

* Remove MapActionSample.csproj from Mvc.slnf

* [Templates] Update the react template to use the CLI proxy (dotnet#31652)

Updates the react template to use the http-proxy-middleware for handling
the requests instead of the asp.net core proxy in the same way it's done
for the Angular template.

* [SignalR] Allocate HubCallerClients once per connection (dotnet#31661)

* [main] Update dependencies from dotnet/emsdk dotnet/efcore dotnet/runtime (dotnet#31576)

[main] Update dependencies from dotnet/emsdk dotnet/efcore dotnet/runtime


 - Add `RemoveDevicePlatformSupport` To `Microsoft.AspNetCore.Authentication.Negotiate.csproj`

Co-authored-by: dotnet-maestro[bot] <42748379+dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Andre Milbradt <andremi@microsoft.com>
Co-authored-by: Andre Milbradt <onegoodsausage@users.noreply.github.com>
Co-authored-by: Pranav K <prkrishn@hotmail.com>
Co-authored-by: Hao Kung <HaoK@users.noreply.github.com>
Co-authored-by: David Fowler <davidfowl@gmail.com>
Co-authored-by: Safia Abdalla <safia@microsoft.com>
Co-authored-by: Kristian Hellang <kristian@hellang.com>
Co-authored-by: msftbot[bot] <48340428+msftbot[bot]@users.noreply.github.com>
Co-authored-by: James Newton-King <james@newtonking.com>
Co-authored-by: Chris Ross <Tratcher@Outlook.com>
Co-authored-by: Steve Sanderson <SteveSandersonMS@users.noreply.github.com>
Co-authored-by: Kevin Pilch <kevinpi@microsoft.com>
Co-authored-by: Javier Calvarro Nelson <jacalvar@microsoft.com>
Co-authored-by: Doug Bunting <6431421+dougbu@users.noreply.github.com>
Co-authored-by: N. Taylor Mullen <nimullen@microsoft.com>
Co-authored-by: Eilon Lipton <Eilon@users.noreply.github.com>
Co-authored-by: Brennan <brecon@microsoft.com>
Co-authored-by: Shreyas Jejurkar <shreyasjejurkar123@live.com>
Co-authored-by: Justin Kotalik <jukotali@microsoft.com>
Co-authored-by: Gabriel Lucaci <gabriel.lucaci.dev@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Tratcher <Tratcher@users.noreply.github.com>
Co-authored-by: John Luo <johluo@microsoft.com>
Co-authored-by: Martin Costello <martin@martincostello.com>
Co-authored-by: William Godbe <wigodbe@microsoft.com>
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Allison Chou <allichou@microsoft.com>
Co-authored-by: Anthony J <reapsprgm@gmail.com>
Co-authored-by: Jonathan Berube <jdberube@gmail.com>
Co-authored-by: dotnet <dotnet@users.noreply.github.com>
Co-authored-by: Günther Foidl <gue@korporal.at>
Co-authored-by: Stephen Toub <stoub@microsoft.com>
Co-authored-by: Ben Adams <thundercat@illyriad.co.uk>
Co-authored-by: Andrzej <andrzej.pindor@gmail.com>
Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: Kevin Jones <vcsjones@github.com>
Co-authored-by: Marek Linka <mareklinka@users.noreply.github.com>
Co-authored-by: Kevin Miller <scoundrel@gmail.com>
Co-authored-by: Michael Simons <msimons@microsoft.com>
Co-authored-by: Youssef Victor <youssefvictor00@gmail.com>
Co-authored-by: Eric Erhardt <eric.erhardt@microsoft.com>
Co-authored-by: fvoronin <fvoronin@gmail.com>
Co-authored-by: Paulo Morgado <470455+paulomorgado@users.noreply.github.com>
Co-authored-by: Tanay Parikh <TanayParikh@users.noreply.github.com>
Co-authored-by: Adrian Wright <47532258+adrianwright109@users.noreply.github.com>
Co-authored-by: Adrian Wright <adrian@compiledcoding.co.uk>
Co-authored-by: Sébastien Ros <sebastienros@gmail.com>
Co-authored-by: Roman Marusyk <Marusyk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI tenet-performance Performance related issue
Projects
None yet
Development

No branches or pull requests

3 participants