Compile error when using MQTTnet.AspNetCore v3.0.3 (and 3.0.7).
See original GitHub issueI get the following compile error when trying to build a sample project with MQTTnet.AspNetCore v3.0.3 from NuGet. I have tried adding MQTTnet v3.0.3 to the project, but with no effect.
The code compile and executes when v3.0.2 is used, but v3.0.3 does not.
1>------ Build started: Project: MqttServerApp, Configuration: Debug Any CPU ------
1>Program.cs(22,13,22,38): error CS0012: The type 'IMqttServer' is defined in an assembly that is not referenced. You must add a reference to assembly 'MQTTnet, Version=3.0.3.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7'.
1>Program.cs(27,13,27,41): error CS0012: The type 'IMqttServerOptions' is defined in an assembly that is not referenced. You must add a reference to assembly 'MQTTnet, Version=3.0.3.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7'.
1>Program.cs(27,13,27,41): error CS0012: The type 'MqttServerOptionsBuilder' is defined in an assembly that is not referenced. You must add a reference to assembly 'MQTTnet, Version=3.0.3.0, Culture=neutral, PublicKeyToken=b69712f52770c0a7'.
1>Done building project "MqttServerApp.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
MqttServerApp.csproj
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="MqttNet.AspNetCore" Version="3.0.3" />
</ItemGroup>
</Project>
Program.cs
using Microsoft.AspNetCore;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using MQTTnet.AspNetCore;
namespace MqttServerApp
{
class Program
{
static void Main(string[] args)
{
WebHost.CreateDefaultBuilder(args).UseStartup<Startup>().Build().Run();
}
}
public class Startup
{
public void Configure(IApplicationBuilder application)
{
application.UseStaticFiles();
application.UseMqttServer(c => { });
}
public void ConfigureServices(IServiceCollection services)
{
services.AddHostedMqttServer(c => { });
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:14
Top Results From Across the Web
Compile error when using MQTTnet.AspNetCore v3.0.3 ...
I get the following compile error when trying to build a sample project with MQTTnet.AspNetCore v3.0.3 from NuGet.
Read more >MQTTnet.AspNetCore.AttributeRouting 0.3.16
Your primary use case is validating/processing the MQTT messages on your server; Your server is not primarily sending data to clients via MQTT ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I released 3.0.4 which works again.
3.0.8 fixes this for me 😃