Question

I updated to Visual Studio 2013 Update 2 RC and to Azure SDK 2.3.

Now I get the following error:

The type or namespace name 'Storage' does not exist in the namespace 'Microsoft.WindowsAzure'

On all three of these:

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;

If I remove these using namespaces then I get the error:

The type or namespace name 'CloudBlobClient' could not be found (are you missing a using directive or an assembly reference?)

On this line:

CloudBlobClient _blobClient;

and I get the little underline in VS suggesting that I add in :

using Microsoft.WindowsAzure.Storage.Blob;

Which is the same namespace that that VS is telling me does not exist.

Any ideas?

Was it helpful?

Solution

On May 12th Microsoft released WindowsAzure.Storage 4.0 on NuGet. Upgrading to this package from 3.1 fixes the issue.

OTHER TIPS

There has been a buggy Azure SDK 2.3 version that included an invalid Newtonsoft.Json assembly.

Solution (from MSDN forums): "Please try deleting or renaming newtonsoft.json.dll in program files\microsoft sdks\windows azure.net sdk\v2.3\ref and the doing a full rebuild. We will be releasing an update to SDK 2.3 to fix this bug, but the above workaround should hopefully unblock you in the meantime."

See here: https://social.technet.microsoft.com/Forums/windowsazure/en-US/038a5759-d0a1-448c-8ed3-560e8c8fb0b5/azure-sdk-23-error-compiling-project-with-azurestorage-in-net-4?forum=windowsazuredevelopment

Perhaps this is obvious but I did not find this solution anywhere else. I eventually figured it out and putting it here for anyone else who faces the same issue.

I cloned by solution to brand new Surface Pro. at the outset, I got like some 30 errors or something. visual studio (2017) usually does this sometimes. After multiple solution clean and rebuild and visual studio restarts, all the errors went away except this one about Storage namespace.

I double checked on my main computer (which has the exact same project and running fine) and found that reference was there but the DLL itself was missing. No missing nuget packages or anything like that.

Eventually, after digging deeper I found that the main computer had the Azure SDK installed but the new Surface Pro obviously did not. I installed the Azure SDK by using the visual studio installer modify/repair option and the problem went away.

add global:: using global::Microsoft.WindowsAzure.Storage;

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top