0
votes

I have a project that references

WindowsAzure.ServiceBus

However, when I rebuild the project, I get the error:

1>C:\Users\xyz\documents\visual studio 2017\Projects\MyProject\Class.cs(1,17,1,27): error CS0234: The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?)

1>C:\Users\xyz\documents\visual studio 2017\Projects\MyProject\Class.cs(12,24,12,38): error CS0246: The type or namespace name 'EventHubClient' could not be found (are you missing a using directive or an assembly reference?)

I've removed and restored the packages directory for the solution, but to no avail. I've tried re-installing the NuGet packages:

Update-Package -reinstall

Which claimed to successfully restore the package. I can Build the project successfully, but a Rebuild fails. Issuing an MSBuild in the command prompt also fails.

Just to alay any theories that there's no using statement, Class.cs:

using Microsoft.ServiceBus.Messaging;

I'm at a loss to how to progress with this; can anyone offer any ideas where to go next?

1
Other than using statements can you do a Solution wide search of Microsoft.ServiceBus and EventHubClient. They might have been used with Fully Qualified namespace.Prateek Shrivastava
Other thing that comes to my mind is to Upgrade you .NET Framework version. If nuget dll was build for higher .NEt runtime, there is just a Warning message printed in Output window and Error window stays clear. But Build fails.Prateek Shrivastava
@PrateekShrivastava spot on - the Framework was on version 4.5 - soon as I upgraded it started working. If you post that as an answer, I'll accept ituser9530048

1 Answers

0
votes

Posting for the points :) (I love them)

Other thing that comes to my mind is to Upgrade your .NET Framework version. If nuget dll was build for higher .NET runtime, there is just a Warning message printed in Output window and Error window stays clear. But Build fails.