用RsaProtectedConfigurationProvider加密数据库连接字符串时,只要App.config有任何改动,都会提示无法识别的属性 configProtectionProvider。 只需要把刷新节点改成刷新配置文件就可以解决: 把 ConfigurationManager.RefreshSection("connectionStrings"); 改成 ConfigurationManager.RefreshSection("configuration");