【问题标题】:Accessing Azure Cloud Storage - CloudConfigurationSettings访问 Azure 云存储 - CloudConfigurationSettings
【发布时间】:2015-09-14 18:48:09
【问题描述】:

我正在使用以下方式访问 Azure 存储连接字符串:

Dim storageAccount As CloudStorageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("BlobConnStr"))

上面给了我一个编译错误:

'CloudConfigurationManager' is not declared. It may be inaccessible due to its protection level

我已经导入了这些库:

Imports Microsoft.WindowsAzure
Imports Microsoft.WindowsAzure.Storage
Imports Microsoft.WindowsAzure.Storage.Auth
Imports Microsoft.WindowsAzure.Storage.Blob

连接字符串在我的 AppSettings 下的 App.config 文件中:

<appSettings>
<add key="BlobConnStr" value="DefaultEndpointsProtocol=https;AccountName=acct_name;AccountKey=acct_key"/>

我研究了连接到 Azure 存储,看起来我做得对。有人可以帮我弄清楚为什么它不起作用吗?

【问题讨论】:

    标签: vb.net azure azure-storage


    【解决方案1】:

    Microsoft.WindowsAzure.ConfigurationManager NuGet 包添加到您的项目中。

      <package id="Microsoft.WindowsAzure.ConfigurationManager" version="3.1.0" targetFramework="net46" />
    

    然后,导入 Microsoft.Azure 命名空间。

    Imports Microsoft.Azure
    

    【讨论】:

      猜你喜欢
      • 2017-07-24
      • 1970-01-01
      • 1970-01-01
      • 2013-02-14
      • 2019-08-24
      • 2014-03-29
      • 1970-01-01
      • 1970-01-01
      • 2017-02-03
      相关资源
      最近更新 更多