question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Asp.net core .Net 5 compatibility?

See original GitHub issue

Describe your question

Hello. I am using the Mqtt server with the AspNetCore integration and trying to upgrade to .Net 5 (RC2). Sadly I get a compile error after upgrading to the latest Mqtt + .Net5 RC2 packages.

The error is: CS7069 Reference to type ‘ConnectionsRouteBuilder’ claims it is defined in ‘Microsoft.AspNetCore.Http.Connections’, but it could not be found.

I found out that the type ConnectionsRouterBuilder is removed with .Net 5 hence the error.

The actual question: Is .Net 5 compatibility in work or is it planned? And if so will it be shipped before the .Net 5 release next month?

Thanks in advance

Which project is your question related to?

  • Server (AspNetCore integration)

Edit:

The method in question is

app.UseEndpoints(endpoints =>
{
    endpoints.MapMqtt("/mqtt");
});

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
314159265meowcommented, Nov 12, 2020

Hi, maybe this is helpful for someone. Using the solution from @Jossec101 we still had a problem with the “Sec-WebSocket-Protocol”.

WebSocket connection to '...' failed: Error during WebSocket handshake: Sent non-empty 'Sec-WebSocket-Protocol' header but no response was received

To fix that we had to specify a SubProtocolSelector, like this:

builder.MapConnectionHandler<MqttConnectionHandler>("/api-gateway", httpConnectionDispatcherOptions => httpConnectionDispatcherOptions.WebSockets.SubProtocolSelector = protocolList => protocolList.FirstOrDefault() ?? string.Empty);

2reactions
SeppPennercommented, Feb 4, 2021

@sean-mcl I have changed the example and it should work now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Breaking changes in .NET 5
Source compatible - Source code will compile successfully without changes when targeting the new runtime or using the new SDK or component.
Read more >
.NET and .NET Core official support policy
Support for ASP.NET Core 2.1 on .NET Framework matches the ASP.NET Support policy for other package-based ASP.NET frameworks. The complete list of packages ......
Read more >
Compatibility for ASP.NET Core
Compatibility ;.NET 5, and .NET 6; Platform-specific versions of .NET 6 for Android, iOS, and MacCatalyst .NET Core 3.0 ; Mono 5.4 and...
Read more >
How to get a .NET core 3.1 Project work with .NET 5.0 project
NET 5 does not ensure backwards compatibility. Microsoft provides information on compatibility and breaking changes here. .NET 5 merges together ...
Read more >
Five Things You Should Know About .NET 5
NET Core doesn't support Web Forms, so the fact it is no longer supported in .NET 5 shouldn't actually be news. However, you...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found