Exporter (0) Imprimer
Développer tout
EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

RoleEnvironment.GetConfigurationSettingValue Method

Updated: December 6, 2013

Retrieves the value of a setting in the service configuration file.

Namespace: Microsoft.WindowsAzure.ServiceRuntime
Assembly: Microsoft.WindowsAzure.ServiceRuntime (in Microsoft.WindowsAzure.ServiceRuntime.dll)

[SecurityPermissionAttribute(SecurityAction.Assert, UnmanagedCode=true)] 
public static string GetConfigurationSettingValue (
	string configurationSettingName
)

Parameters

configurationSettingName

Type: System.String

The name of the configuration setting.

Return Value

Type: System.String

A String that contains the value of the configuration setting.

Exception typeCondition
RoleEnvironmentException

The configuration setting that was being retrieved does not exist.

Configuration settings for a role are defined in the ServiceDefinition.csdef file and the values for the settings are configured in the ServiceConfiguration.cscfg file. For more information about defining and configuring settings, see the following information:

The GetConfigurationSettingValue method can be used to retrieve the value that is defined in the ServiceConfiguration.cscfg file. The following code example shows how to get and write out the value for a setting called MySetting:


var settingValue = RoleEnvironment.GetConfigurationSettingValue("MySetting"); 
Trace.WriteLine("The setting value is: " + settingValue, "Information");

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

Ajouts de la communauté

AJOUTER
Microsoft réalise une enquête en ligne pour recueillir votre opinion sur le site Web de MSDN. Si vous choisissez d’y participer, cette enquête en ligne vous sera présentée lorsque vous quitterez le site Web de MSDN.

Si vous souhaitez y participer,
Afficher:
© 2014 Microsoft