So this a new one for me.
I'm trying to define a ConfigurationSection class in my class library that pulls from App.Config in my WinForms app. I've never done this before but from following examples this is where I've got to.
app.config in my WinForms app
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="ReportEngineConfig" type="Optima.ReportEngine.ReportEngineConfig" allowDefinition="Everywhere" allowLocation="true"/>
</configSections>
<ReportEngineConfig>
<ReportObjectVariableRegEx value="test" ></ReportObjectVariableRegEx>
</ReportEngineConfig>
</configuration>
And my ConfigurationSection class in my seperate class library.
using System.Configuration;
namespace Optima.ReportEngine
{
public class ReportEngineConfig : ConfigurationSection
{
[ConfigurationProperty("ReportObjectVariableRegEx")]
public string ReportObjectVariableRegEx
{
get
{
return (string)this["value"];
}
}
}
}
So any chance anyone can point out where I've gone wrong
Thanks!