I am trying to develop a C# application that contains a managed MQTT client. I am using MQTTnet and MQTTnet.Extensions.ManagedClient. I have seen some examples of how to do this using MQTTnet version 3.0.16. I have downloaded and built a project that implements an MQTT client using this pair of nuget packages.
When I allow Visual Studio 2022 to update the nuget packages (MQTTnet and MQTTnet.Extensions.ManagedClient) to the latest versions (4.2.1.781 and 4.2.1.781, respectively), Visual Studio reports design-time errors related to the following namespaces missing: MQTTnet.Client.Connecting, MQTTnet.Client.Disconnecting, MQTTnet.Client.Options, MQTTnet.Client.Receiving.
Does this indicate that the latest version of MQTTnet has significant changes? If so, are there more modern examples for using MQTTnet and MQTTnet.Extensions.ManagedClient?
I used MQTTnet version 3.0.16 successfully. When I upgraded to version 4.2.1.781, the example no longer compiled.
I haven't tried it yet, but I did find a sample using MQTTnet version 4: https://blog.behroozbc.ir/mqtt-client-with-mqttnet-4-and-c
modified answer: I have found and tried https://github.com/SeppPenner/MQTTnet.TestApp.WinForm, which uses MQTTnet Managed Client version 4. Actually, it is a Windows Forms app (.NET Core) that appears to have been developed without using the new GUI designer in Visual Studio. I have moved the source into a Windows Forms app (.NET Framework, since GUI designer is still preview). It works well.