c# - VS2012 表示 ConnectionStrings 部分为 "The configProtectionProvider attribute is not allowed"

标签 c# connection-string

尽管this page在标签中显示属性,当我尝试对其进行编码时,我在线下看到了可怕的蓝色波浪线,悬停消息就像我在这个问题的标题中输入的那样。我需要做什么才能激活此功能,因为 Microsoft 的页面清楚地表明它是通过这种方式完成的。

谢谢, 彼得

最佳答案

我认为 configProtectionProvider 属性仅在 .NET 2.0 中受支持。您可以通过添加以下内容来使用它

xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0" 

像这样到您的配置节点:

<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
  <connectionStrings configProtectionProvider="RsaProtectedConfigurationProvider">
    <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element"

关于c# - VS2012 表示 ConnectionStrings 部分为 "The configProtectionProvider attribute is not allowed",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21339898/

相关文章:

.net-core - FluentMigrator 两个 SQL 数据库

c# - 对类型约束的反射(reflection)

c# - 'System.Drawing.Graphics.FromImage(System.Drawing.Image )' is a ' 方法'但像 'type' 一样使用

c# - WinForms UserControl 如何停止控件接收焦点

c# - 另一个二维数组分配问题c#

c# - 使用 Transaction Binding=Explicit Unbind 时连接不会关闭;在连接字符串中

c# - ValidationRule ValidatesOnTargetUpdated NullReferenceException 在设计时

sql-server-2008 - sql server 2008连接字符串错误

c# - 如何通过 SSH 从 C# 连接到 mysql

c# - 测试 - 缺少连接字符串