2016-04-29 69 views
0

「Microsoft Azure配置管理器」庫與UAP應用程序不兼容,似乎我需要它來訪問CloudConfigurationManager類以連接到Azure存儲。它是用來解析連接字符串:「Microsoft Azure配置管理器」庫不適用於UWP應用程序。建議?

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

我在這裏失去了一些東西或者是有可能用於獲取用於連接UWP應用程序開發人員的替代方法?

我指的是該指南:HERE

+0

我想你可以直接使用HttpClient調用REST API。 – gdc

回答

0

按一月,有對Azure存儲作爲UWP客戶端庫不支持。我無法找到是否有任何更新,所以我想你使用REST API而不是客戶端庫(至少現在)。無論如何,客戶端庫僅僅是REST API的封裝。此外,我試圖最近找到任何隨時可用的最新Azure存儲包裝器,由社區編寫,看起來最簡單的方法是自己編寫它,而不是嘗試找到現成的解決方案(大多數解決方案我發現是舊的)。

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

0

我不相信你必須使用CloudConfigurationManager。

您可以手動連接到它:

var credentials = new StorageCredentials("accountname", "accountkey"); 
var account = new CloudStorageAccount(credentials, true); 

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

相關問題