Skip to content

Error loading System.Buffers, Version=4.0.2.0 when using AspNet Core SignalR C# client in a .NET Framework 4.7.1 Web test #27774

@jeremymeng

Description

@jeremymeng
  1. clone to get the signalr chat sample at https://github.com/aspnet/SignalR-samples/tree/master/ChatSample
  2. open the solution, restore nuget package and Ctrl+F5 to run the service
  3. clone the webtest repro project at https://github.com/jeremymeng/WebTestRepro
  4. open WebAndLoadTestProject2.sln, restore then build the project. You will need the web test payload for your visual studio installation to support this type of project.
    image
  5. notice that the bin\Debug directory has 41 files
  6. now open the webtest.webtest file in visual studio. select Debug Test, pause before starting from the drop down

image

  1. under web test solution folder, check the most recent TestResults\<user_machineName timestamp>\Out folder. This is where the test is actually running. The folder only has 25 files under it. (This could be a bug in Web Test framework. I already logged a separate internal bug against VSTT team)
  2. copy all files from bin\Debug folder into the Out folder (skip existing)
  3. click Run button (the first button) to continue the web test
    image

Actual:

System.IO.InvalidDataException
  HResult=0x80131501
  Message=Invalid negotiation response received.
  Source=Microsoft.AspNetCore.Http.Connections.Common
  StackTrace:
   at Microsoft.AspNetCore.Http.Connections.NegotiateProtocol.ParseResponse(Stream content)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.<NegotiateAsync>d__45.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.<GetNegotiationResponseAsync>d__52.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.<SelectAndStartTransport>d__44.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.<StartAsyncCore>d__41.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Http.Connections.Client.HttpConnection.<StartAsync>d__40.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.SignalR.Client.HttpConnectionFactory.<ConnectAsync>d__3.MoveNext()
   at Microsoft.AspNetCore.SignalR.Client.HttpConnectionFactory.<ConnectAsync>d__3.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.<StartAsyncCore>d__31.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.SignalR.Client.HubConnection.<StartAsync>d__24.MoveNext()
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at iRel8.Service.WebTests.WebtestPlugins.SignalRJoinRoomPlugin.<PreRequest>d__0.MoveNext() in C:\github\jeremymeng\WebTestRepro\WebAndLoadTestProject2\SignalRJoinRoomPlugin.cs:line 16

Inner Exception 1:
TypeInitializationException: The type initializer for 'JsonArrayPool`1' threw an exception.

Inner Exception 2:
FileNotFoundException: Could not load file or assembly 'System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions