Search code examples
azureasp.net-coreservicebus

Cannot install Microsoft.Azure.ServiceBus using NuGet


I'm running a test .Net Core Console app to try using ServiceBus messages. However after using Nuget to install Microsoft.Azure.ServiceBus v3.1.1 I get the following error

Package Microsoft.Azure.ServiceBus 3.1.1 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package Microsoft.Azure.ServiceBus 3.1.1 supports: netstandard2.0 (.NETStandard,Version=v2.0)

I've tried installing up to v3.3.0 and get the same, I'm using the latest .Net framework and have updated my VS2017 so I don't know what the problem can be. Has anyone else had this issue?


Solution

  • I don't know what the problem can be

    No matter the version of package Microsoft.Azure.ServiceBus is v3.1.1 or v3.3.0, both of their Dependencies is .NETStandard 2.0 while your app is .NetStandard 1.0. So, as Peter said, the version of .net core you have is too old.

    You could go to download the latest .Net Core SDK and then reinstall the package you want.

    Or you could download the Microsoft.Azure.ServiceBus v1.0.0. However, because the version is too old, some feature may not have. So, I suggest that you could update your TargetFramework to .net core 2.0+.