0

I have written:

namespace MyProject.Azure
{
    using Azure.Storage.Blobs;
}

I get the error

[csharp CS0234] [E] The type or namespace name 'Storage' does not exist in the namespace 'MyProject.Azure' (are you missing an assembly reference?)

I guess that because my current namespace ends with Azure, I am confusing C# somehow.

How can I use the top-level NuGet package Azure.Storage.Blobs, instead of try to search my current project?

theonlygusti
  • 11,032
  • 11
  • 64
  • 119
  • https://stackoverflow.com/questions/23092712/the-type-or-namespace-name-storage-does-not-exist-in-the-namespace-microsoft – abhinavsinghvirsen Jan 17 '21 at 12:17
  • 1
    any reason why you are not using the `using Azure.Storage.Blobs;` before the namesapce declaration? – Benzara Tahar Jan 17 '21 at 12:17
  • You can use `using global::Azure.Storage.Blobs;` or put the using outside and before the namespace declaration instead of inner, that is more conventionnal, unless you have a good reason. –  Jan 17 '21 at 12:20
  • 1
    Thanks it was `global::` after all. I had tried `global.` forgetting it was colons – theonlygusti Jan 17 '21 at 12:32
  • @BenzaraTahar it seems to be better for scope and make code less likely to break: https://stackoverflow.com/a/151560/3310334 – theonlygusti Jan 29 '21 at 12:35

0 Answers0