0

I am unable to retrieve configuration setting values from Azure service configuration file.

I am able to run the application in local machine but after uploading the package into the azure site. Then while browing the application it is throwing the error. I tried to read the values in the below two ways.

public readonly static string CONNECTIONSTRING = Decrypt.DecryptMsg(CloudConfigurationManager.GetSetting("ConnectionString"));

and

public readonly static string CONNECTIONSTRING = Decrypt.DecryptMsg(RoleEnvironment.GetConfigurationSettingValue("ConnectionString"));

It is throwing an error that

Exception Occurred ::The type initializer for 'Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment' threw an exception"

Please help me in resolving this error.

Nag Arjun
  • 115
  • 2
  • 12
  • Take a look here and see if this solves the problem: http://stackoverflow.com/questions/16560053/the-type-initializer-for-microsoft-windowsazure-serviceruntime-roleenvironment – Gaurav Mantri Oct 31 '14 at 15:13
  • No Gaurav, It is not working. The main thing here is, I am able to run the application in my local machine by selecting the azure project solution as start up project. After uploading the package into azure site, I am getting this error. Please help me in solving this error as this error occuring from last one month. – Nag Arjun Nov 03 '14 at 11:48

0 Answers0