Settings must be of the form “name=value”. No idea what to do

前端 未结 3 647
名媛妹妹
名媛妹妹 2021-01-17 15:28

So I\'m parsing a connection string for an Azure Storage Account and when I get to the page of the app that uses the connection string, the compiler catches an exception sta

3条回答
  •  别那么骄傲
    2021-01-17 16:16

    Add a reference to System.Configuration.dll and add using System.Configuration; in the file.

    Then change your first line to this:

    CloudStorageAccount storageaccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
    

    You need to get the value, not just pass the key to Parse.

提交回复
热议问题