C# Can';找不到.NET2.0XML模式
我目前正在为用.NET4.0编写的WPF应用程序设置应用程序配置。app.config中的连接字符串加密如下:C# Can';找不到.NET2.0XML模式,c#,xml,.net-2.0,app-config,xml-namespaces,C#,Xml,.net 2.0,App Config,Xml Namespaces,我目前正在为用.NET4.0编写的WPF应用程序设置应用程序配置。app.config中的连接字符串加密如下: <connectionStrings configProtectionProvider="DataProtectionConfigurationProvider"> <EncryptedData> <CipherData> <CipherValue>CypherValue</CipherVal
<connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>CypherValue</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
香附值
要使用EncryptedData元素,我需要包含XMLNS“”。由于找不到架构,尝试包含它会产生错误。有没有一种方法可以包含模式或其他元素来代替EncryptedData
编辑以下是我的整个app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<section name="dataconfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterPriseLibrary.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=aebf961ca224e888"/>
</configSections>
<dataconfiguration defaultDatabase="LoanersTest">
<providerMappings>
<add databaseType="Microsoft.Practices.EnterpriseLibrary.Data.Sql.Database, Microsoft.Practices.EnterpriseLibrary.Data, Version=3.0.0.0, Culture=neutral, PublicKeyToken=aebf961ca224e888" name="System.Data.SqlClient" />
</providerMappings>
</dataconfiguration>
<appSettings>
<add key="BufferSize" value="999999"/>
</appSettings>
<connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
<EncryptedData>
<CipherData>
<CipherValue>
CypherValue
</CipherValue>
</CipherData>
</EncryptedData>
</connectionStrings>
</configuration>
香附值
编辑:在app.config中添加了我最初尝试的xmlns
编辑2:为没有包含错误而道歉
尝试运行项目时出错:无法启动程序“C:…\program.exe”。由于应用程序配置不正确,此应用程序无法启动。检查清单文件是否存在可能的错误。重新安装应用程序可能会解决此问题。有关更多详细信息,请参阅应用程序事件日志。尝试将其包括在内是什么意思?显示您尝试的内容。@JohnSaunders我已经编辑了主帖,以包含我尝试执行的全部内容。请尝试仅将该xmlns放在EncryptedData元素本身上。仍然找不到架构。已尝试将其放在ConnectionString元素上,但configProtectionProvider不是允许的属性。您到底遇到了什么错误?我不相信这是“寻找模式”