-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
System.Numerics.Vectors binding redirect missing #41597
Comments
Tagging subscribers to this area: @tannergooding, @pgovind |
CC. @ericstj. Seems devs are still having issues with System.Numerics.Vectors bindings out of the box, is there anything we can do here to improve the situation so the default path "just works"? |
BindingRedirects will always be required when using nuget packages on desktop. Usually MSBuild will automatically detect when these are needed, but it is missing the case for System.Numerics.Vectors here. This is because the conflict is coming from the two assemblies: The version of System.Net.WebSockets.WebSocketProtocol referenced is 4.5.1 from Microsoft.AspNetCore.WebSockets. That version of WebSocketProtocol uses a different reference assembly than implementation and its reference assembly does not use System.Numerics.Vectors, so MSBuild never sees the conflict. If you reference a newer version of System.Net.WebSockets.WebSocketProtocol the problem goes away: <PackageReference Include="System.Net.WebSockets.WebSocketProtocol" Version="4.7.1" /> This version uses a newer version of System.Numerics.Vectors, so there is no conflict. This version also ensures it's implementation assembly is exposed for reference on .NETFramework, so even if there were a conflict MSBuild would see it and write the bindingRedirect. |
Thank you for the detailed (and quick) response. I can confirm that my example application is working when I add the reference to the later version of I'll close this issue and reference the answer on the aspnetcore project (where I initially logged the issue) - hopefully they can update the necessary NuGet packages to the working versions. If not, I can always use the (newer reference) workaround. |
Description
I have a .NET Core 2 application that is targeting the full .NET Framework (v4.8).
It hosts a web server (using HttpSys) that exposes a SignalR hub.
I can make a successful call from a client (in this case a .NET console application) to the SignalR hub.
Both the client and the server applications are making use of the new "SDK-style" projects.
When I upgrade the System.Collections.Immutable library on the server to v1.7.1, the connection call from the client application to the SignalR hub on the server fails with a WebSocketException.
Using the fusion log viewer, I've traced the problem to a missing binding redirect - the server code is trying to load System.Numerics.Vectors v4.1.3, while the output directory contains v4.1.4. If I add the required binding redirect manually in the app.config, everything works as expected.
Fusion log viewer:
Binding redirect:
I had a look (and tried the suggestions) in the following issues, but did not manage to solve the problem:
#27506
#26370
dotnet/sdk#901
To Reproduce
I have attached a sample solution that reproduces the problem.
SignalRBug.zip
The solution contains 2 projects: "Client" and "Server".
An instance of "Server" must be running (hosting on http://localhost:8080) before you can execute "Client".
The example (as attached) will run without any errors.
When you edit the Server.csproj file to include the latest version of the System.Collections.Immutable library, the client application will fail as described above.
Configuration
Thank you. If you require any additional information, please let me know.
The text was updated successfully, but these errors were encountered: