简体   繁体   English

命名空间“Microsoft.WindowsAzure”中不存在类型或命名空间名称“Storage”

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

I updated to Visual Studio 2013 Update 2 RC and to Azure SDK 2.3.我更新到 Visual Studio 2013 Update 2 RC 和 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?)找不到类型或命名空间名称“CloudBlobClient”(您是否缺少 using 指令或程序集引用?)

On this line:在这一行:

CloudBlobClient _blobClient;

and I get the little underline in VS suggesting that I add in :我在 VS 中得到了一个小下划线,建议我添加:

using Microsoft.WindowsAzure.Storage.Blob;使用 Microsoft.WindowsAzure.Storage.Blob;

Which is the same namespace that that VS is telling me does not exist. VS 告诉我的命名空间不存在。

Any ideas?有任何想法吗?

On May 12th Microsoft released WindowsAzure.Storage 4.0 on NuGet. 5 月 12 日,Microsoft 在 NuGet 上发布了 WindowsAzure.Storage 4.0。 Upgrading to this package from 3.1 fixes the issue.从 3.1 升级到这个包修复了这个问题。

There has been a buggy Azure SDK 2.3 version that included an invalid Newtonsoft.Json assembly.有一个有问题的 Azure SDK 2.3 版本,其中包含无效的 Newtonsoft.Json 程序集。

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."解决方案(来自 MSDN 论坛):“请尝试删除或重命名程序 files\\microsoft sdks\\windows azure.net sdk\\v2.3\\ref 中的 newtonsoft.json.dll 并进行完全重建。我们将发布更新到SDK 2.3 修复此错误,但上述解决方法有望同时解除对您的阻止。”

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请参阅此处: 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.我通过解决方案克隆到全新的 Surface Pro。 at the outset, I got like some 30 errors or something.一开始,我遇到了大约 30 个错误之类的。 visual studio (2017) usually does this sometimes. Visual Studio (2017) 通常有时会这样做。 After multiple solution clean and rebuild and visual studio restarts, all the errors went away except this one about Storage namespace.在多个解决方案清理和重建以及重新启动 Visual Studio 后,所有错误都消失了,除了这个关于 Storage 命名空间的错误。

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.我仔细检查了我的主计算机(它有完全相同的项目并且运行良好),发现引用在那里,但 DLL 本身丢失了。 No missing nuget packages or anything like that.没有丢失的 nuget 包或类似的东西。

Eventually, after digging deeper I found that the main computer had the Azure SDK installed but the new Surface Pro obviously did not.最终,经过深入挖掘,我发现主计算机安装了 Azure SDK,但新的 Surface Pro 显然没有安装。 I installed the Azure SDK by using the visual studio installer modify/repair option and the problem went away.我使用 Visual Studio 安装程序修改/修复选项安装了 Azure SDK,问题就消失了。

添加global:: using global::Microsoft.WindowsAzure.Storage;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 命名空间“Microsoft.WindowsAzure”中不存在类型或命名空间名称“诊断” - Type or namespace name 'Diagnostics' does not exist in the namespace 'Microsoft.WindowsAzure' 使用Microsoft.WindowsAzure在命名空间中不存在StorageClient - StorageClient does not exist in the namespace using Microsoft.WindowsAzure Azure 内部版本 - 名称空间“Microsoft”中不存在类型或名称空间名称“OpenApi” - Azure Builds - The type or namespace name 'OpenApi' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Bot”? - The type or namespace name 'Bot' does not exist in the namespace 'Microsoft'? 命名空间“Microsoft”中不存在类型或命名空间名称“ServiceBus” - The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“Azure” - The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' 命名空间“Microsoft”中不存在类型或命名空间名称“ServiceBus”? - The type or namespace name 'ServiceBus' does not exist in the namespace 'Microsoft'? 命名空间“Microsoft”中不存在类型或命名空间名称“AspNetCore” - The type or namespace name 'AspNetCore' does not exist in the namespace 'Microsoft' 错误 CS0234:命名空间“Microsoft”中不存在类型或命名空间名称“Azure”(您是否缺少程序集引用?) - error CS0234: The type or namespace name 'Azure' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) 命名空间“Microsoft.Bot.Builder”中不存在类型或命名空间名称“Dialogs” - The type or namespace name 'Dialogs' does not exist in the namespace 'Microsoft.Bot.Builder'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM