I'm trying to use ConfigurationManager.AppSettings.GetValues()
to retrieve multiple configuration values for a single key, but I'm always receiving an array of only the last value. My appsettings.config
looks like
<add key="mykey" value="A"/>
<add key="mykey" value="B"/>
<add key="mykey" value="C"/>
and I'm trying to access with
ConfigurationManager.AppSettings.GetValues("mykey");
but I'm only getting { "C" }
.
Any ideas on how to solve this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…