代码改变世界

无法识别的属性 configProtectionProvider的解决方案

2013-08-22 11:09  假面Wilson  阅读(1204)  评论(0编辑  收藏  举报

用RsaProtectedConfigurationProvider加密数据库连接字符串时,只要App.config有任何改动,都会提示无法识别的属性 configProtectionProvider。

只需要把刷新节点改成刷新配置文件就可以解决:

ConfigurationManager.RefreshSection("connectionStrings");

改成

ConfigurationManager.RefreshSection("configuration");