jason-roberts / FeatureToggle

Simple, reliable feature toggles in .NET
http://dontcodetired.com/blog/?tag=/featuretoggle
Apache License 2.0
687 stars 111 forks source link

The connection string was not configured in <appSettings> #137

Closed eliassal closed 7 years ago

eliassal commented 7 years ago

Hi, I have an mvc project using this featureToggle and compiles with no issues in visual studio. I have 2 keys in the web.cong as follows:

<add key="FeatureToggle.HomePageFeatureToggle.SqlStatement" value="select Enabled from FeatureToggles where Name = 'HomePagefeatureToggle'"/>

The table FeatureToggles is populated with data. Running the site, I get the following error:

The connection string was not configured in with a key of 'FeatureToggle.HomePagefeatureToggle.ConnectionString' or 'FeatureToggle.HomePagefeatureToggle.ConnectionStringName' nor in

with a name of 'FeatureToggle.HomePagefeatureToggle'.

which is not true.

Thanks for your help

eliassal commented 7 years ago

Here are the keys in appSettings

add key="FeatureToggle.HomePageFeatureToggle.ConnectionString" value="MusicStoreEntities" add key="FeatureToggle.HomePageFeatureToggle.SqlStatement" value="select Enabled from FeatureToggles where Name = 'HomePagefeatureToggle'"

jason-roberts commented 7 years ago

hi @eliassal the error says "HomePagefeatureToggle", your config has a different case F "HomePageFeatureToggle"

eliassal commented 7 years ago

Oh my bad, so it is case sensitive, thanks, yes it is working like a charm now Salam