BuildMaster Documentation

.net - Ensure AppSetting

  • Last Modified: 2019-07-30

This is generated from the built-in components of BuildMaster 6.1.10, and may be different than what you have installed (especially if you have extensions); go to [User Icon] > Documentation within your BuildMaster instance to see exactly what operations are available.

Ensure AppSetting

Ensures a .NET application configuration file has the specified appSetting key/value pair.

Script usage:

DotNet::Ensure-AppSetting(
	File: <text>,
	Key: <text>,
	Value: <text>,
	[AppSettingsXPath: <text>]
);

Arguments:

Name Format Script Usage Usage Notes
Config file path
text
File
The file path of the configuration file, typically web.config or app.config. This argument is required.
AppSetting key
text
Key
This argument is required.
AppSetting value
text
Value
This argument is required.
XPath for appSettings
text
AppSettingsXPath

Note: By default, the "appSettings" section must exist in the file under the "configuration" element in order to ensure the key/value pair is present. Use the AppSettingsXPath argument to select a different element instead.

Example:

# ensures that the application is configured to use test mode for the example third-party API
DotNet::Ensure-AppSetting(
	File: E:\Website\web.config,
	Key: Accounts.ThirdParty.PaymentApi,
	Value: https://test.example.com/api/v3
);

Is this documentation incorrect or incomplete? Help us by contributing!

This documentation is licensed under CC-BY-SA-4.0 and stored in GitHub.

Generated from commit ce197caa on master