我无法从 Azure 服务配置文件中检索配置设置值。
我可以在本地机器上运行应用程序,但是在将包上传到天蓝色站点之后。然后在浏览应用程序时抛出错误。 我尝试通过以下两种方式读取值。
public readonly static string CONNECTIONSTRING = Decrypt.DecryptMsg(CloudConfigurationManager.GetSetting("ConnectionString"));
和
public readonly static string CONNECTIONSTRING = Decrypt.DecryptMsg(RoleEnvironment.GetConfigurationSettingValue("ConnectionString"));
它抛出一个错误
发生异常 ::'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' 的类型初始化程序引发异常”
请帮助我解决此错误。