Application Settings

The Microsoft .NET Framework allows you to specify settings in an application-specific configuration file. The configuration file must have the same name as the application and carry the .config extension (for example, myapplication.exe.config). For ASP.NET Web applications, the extension is web.config.

The configuration file is an XML file with the following schema:

<configuration>
  <startup />
  <runtime />
  <appSettings>
    <add key=”mykey” value=”myvalue />
  </appSettings>
  <system.runtime.remoting />
  …
</configuration>

When such a file is present, the .NET runtime reads the settings and configures the internal runtime. With the key appSettings you can specify key/value pairs that can be read during runtime. A useful application for this is connection strings or other configuration properties. By changing the settings in the XML file, the behavior of the application can be adjusted without changing the code.

The App Settings options tab facilitates the testing of .NET components by enabling you to specify key/value pairs. The option page not only allows you to define settings, it also enables you to initialize settings from an existing .config file. This saves time when you already have a .config file that contains all settings and meaningful values.

You can browse (...) to and Load a .config file, in which case all appSettings are used to initialize the grid control, or you can add the entries manually. Changes take effect when you click OK.

When a project is exported as a standalone application, an app.exe.config file that includes the appSettings is exported.

When exporting to either a Microsoft Visual Studio project or a Silk Performer .NET project, a app.config file with only the appsettings entries is created. The app.config file is read by the perfrun when a virtual user is executed. Perfrun takes those settings and uses them to write a perfrun.exe.config file, which contains other settings as well.