dotnet / dotnet/dotnet-api-docs

example code does not work with sample config file

Open
#1,507 1 comment 0 reactions 0 assignees View on GitHub
area-System.Configuration dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

the api used, `Environment.ExpandEnvironmentVariables(rawXmlString)` will only work when the config file has the following `<add key="COMPUTERNAME" value="%COMPUTERNAME%" />`

Environment.ExpandEnvironmentVariables only expands % delimited tokens.

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 9fdfd344-8a4b-f23d-c040-ee6982322041
* Version Independent ID: d9b615a6-1846-e521-b671-c7d384be68cb
* Content: [ConfigurationBuilder Class (System.Configuration)](https://docs.microsoft.com/en-us/dotnet/api/system.configuration.configurationbuilder?view=netframework-4.7.1&WT.mc_id=azure-blog-antchu)
* Content Source: [xml/System.Configuration/ConfigurationBuilder.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System.Configuration/ConfigurationBuilder.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.