Skip to content

Conversation

@akoeplinger
Copy link
Member

@akoeplinger akoeplinger commented Oct 2, 2020

We were pulling in Microsoft.AspNetCore 2.2 via a nuget PackageReference, but after upgrading Microsoft.Extensions.Logging in #315 we saw the following error when using the "wasm test-browser" command:

fail: Microsoft.AspNetCore.Server.Kestrel[0]
      Heartbeat.OnHeartbeat
      System.TypeLoadException: Could not load type 'Microsoft.Extensions.Primitives.InplaceStringBuilder' from assembly 'Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
         at Microsoft.Net.Http.Headers.DateTimeFormatter.ToRfc1123String(DateTimeOffset dateTime, Boolean quoted)
         at Microsoft.Net.Http.Headers.HeaderUtilities.FormatDate(DateTimeOffset dateTime, Boolean quoted)
         at Microsoft.Net.Http.Headers.HeaderUtilities.FormatDate(DateTimeOffset dateTime)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.DateHeaderValueManager.SetDateValues(DateTimeOffset value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.DateHeaderValueManager.OnHeartbeat(DateTimeOffset now)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.Heartbeat.OnHeartbeat()

The reason is that the newer version of Microsoft.Extensions.Primitives removed InplaceStringBuilder.

Instead of using an old ASP.NET we can use the one in the framework instead, which is what's recommended since .NET Core 3.0

…nuget

We were pulling in Microsoft.AspNetCore 2.2 via a nuget PackageReference, but after upgrading Microsoft.Extensions.Logging in dotnet#315
we saw the following error when using the "wasm test-browser" command:

```
�[41m�[30mfail�[39m�[22m�[49m: Microsoft.AspNetCore.Server.Kestrel[0]
      Heartbeat.OnHeartbeat
      System.TypeLoadException: Could not load type 'Microsoft.Extensions.Primitives.InplaceStringBuilder' from assembly 'Microsoft.Extensions.Primitives, Version=5.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
         at Microsoft.Net.Http.Headers.DateTimeFormatter.ToRfc1123String(DateTimeOffset dateTime, Boolean quoted)
         at Microsoft.Net.Http.Headers.HeaderUtilities.FormatDate(DateTimeOffset dateTime, Boolean quoted)
         at Microsoft.Net.Http.Headers.HeaderUtilities.FormatDate(DateTimeOffset dateTime)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.DateHeaderValueManager.SetDateValues(DateTimeOffset value)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.DateHeaderValueManager.OnHeartbeat(DateTimeOffset now)
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure.Heartbeat.OnHeartbeat()
```

The reason is that the newer version of Microsoft.Extensions.Primitives removed InplaceStringBuilder.

Instead of using an old ASP.NET we can use the one in the framework instead, which is what's recommended since .NET Core 3.0
@akoeplinger akoeplinger requested review from premun and radical October 2, 2020 11:18
Copy link
Member

@radical radical left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I had a local fix but this looks better 👍

@akoeplinger akoeplinger force-pushed the fix-aspnet branch 5 times, most recently from 93a88e9 to c53699f Compare October 2, 2020 14:07
akoeplinger added a commit to dotnet/arcade that referenced this pull request Oct 2, 2020
This allows getting the Microsoft.AspNetCore.App shared framework instead of just Microsoft.NETCore.App.

Helps to unblock dotnet/xharness#324.
@akoeplinger akoeplinger merged commit 2f3293f into dotnet:master Oct 2, 2020
@akoeplinger akoeplinger deleted the fix-aspnet branch October 2, 2020 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants