Build errors in .net 5 after migration to 3.0.14
See original GitHub issueDescribe the bug
In my solution I’ve a netstandard2.1 class library that references MQTTnet and then a couple of net5 test projects that reference that class library.
As soon as I upgrade MQTTnet from v3.0.13 to v3.0.14 I start getting some weird build errors like the following one:
MqttProducerEndpointBuilderTests.cs(20, 59): [CS0012] The type 'MqttClientOptions' is defined in an assembly that is not referenced. You must add a reference to assembly 'MQTTnet, Version=3.0.14.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7'.
Directly referencing the MQTTnet nuget package in the test projects doesn’t help.
No problem with v3.0.13 and v3.0.14 also seems to work if the test projects are targeting netcore3.1 instead of net5.
Which project is your bug related to?
- Client
Code example
See the broken branch https://github.com/BEagle1984/silverback/tree/feature/update-mqttnet-net5 (MQTTnet 3.0.14 with net5 test projects).
Here is a working branch with MQTTnet 3.0.14 and netcore3.1: https://github.com/BEagle1984/silverback/tree/feature/update-mqttnet-netcore31 And here is a working branch with MQTTnet 3.0.13 and net5: https://github.com/BEagle1984/silverback/tree/feature/net5
Issue Analytics
- State:
- Created 3 years ago
- Comments:7

Top Related StackOverflow Question
It seems to work correctly with the 3.0.15-rc1. Well done.
Closing because the issue is fixed.