Configuration settings in 3.5 is driving me nuts... Help! ;)
I have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc).
I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings.
Here is part of my app.config for my windows forms application:
<applicationSettings>
<PhotoImportRobot.My.MySettings>
<setting name="ADIImageRoot" serializeAs="String">
<value>C:DataTempADIOriginal</value>
</setting>
<setting name="ADIImageVariantsRoot" serializeAs="String">
<value>C:DataTempADIVariants</value>
</setting>
</PhotoImportRobot.My.MySettings>
</applicationSettings>
How do I access that from my class library??
I tried this:
System.Configuration.ConfigurationManager.AppSettings("ADIImageVariantsRoot")
What to do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…