RickStrahl / Westwind.Globalization

Database driven resource localization for .NET applications
544 stars 135 forks source link

config value for DbResourceDataManagerType is not taken into account #39

Closed okli23 closed 9 years ago

okli23 commented 9 years ago

Even if you declare MySql provider in web.config:

<DbResourceConfiguration>
   (...)
   <add key="DbResourceDataManagerType" value="Westwind.Globalization.DbResourceMySqlDataManager" />
</DbResourceConfiguration>

, it is not taken into account (ResourceProviderInfo on /LocalizationAdmin/index.html shows that default DbResourceSqlServerDataManager is in use).

A workaround is to set it explicitly in Application_Start:

DbResourceConfiguration.Current.DbResourceDataManagerType = typeof(DbResourceMySqlDataManager);

It would be nice to have it working based on web.config only, especially, that this option seems to be supported (https://github.com/RickStrahl/Westwind.Globalization/blob/6c9f73f334739ec0be4eb8b0506d81de386b1131/Westwind.Globalization.Test/App.config).

RickStrahl commented 9 years ago

Actually it's not supported and the key is not supposed to be in the configuration settings (it's marked non-serialized).

I played around with this a while ago, but decided not to implment the functionality because if it's wrong nothing will work. Forcing this to be a dev time setting at least forces you to use a proper type.