" Microsoft Azure配置管理器"库不适用于UWP应用程序。建议?

时间:2016-04-29 20:57:33

标签: c# azure win-universal-app

" Microsoft Azure配置管理器"库与UAP应用程序不兼容,似乎我需要它来访问CloudConfigurationManager类以连接到Azure存储。它用于解析连接字符串:

// Parse the connection string and return a reference to the storage account.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
    CloudConfigurationManager.GetSetting("StorageConnectionString"));

我在这里遗漏了什么,或者是否有可能为UWP应用开发者提供连接的替代方法?

指南我指的是:HERE

2 个答案:

答案 0 :(得分:0)

截至1月份,Azure Storage不支持作为UWP客户端库。我无法找到是否有任何更新,所以我想你使用REST API而不是客户端库(至少现在)。无论如何,客户端库只是REST API的包装器。此外,我试图找到最近由社区编写的任何现成的最新Azure存储包装器,看起来最简单的方法是自己编写而不是试图找到现成的解决方案(大多数解决方案)我发现他们已经老了。

REST API reference Tutorial on how to use Azure Storage REST API

答案 1 :(得分:0)

我不相信你必须使用CloudConfigurationManager。

您可以手动连接到它:

ObservableCollection<MyString> someStrings = new ObservableCollection<MyString>()

 class MyString
 {
     public string myString{get;set} 
 }

注意:您必须引用WindowsAzure.Storage,但它与UWP兼容。它的配置管理器不是。