Я пытаюсь зашифровать конфиденциальную информацию о строке подключения в моем файле app.config для приложения С#, которое я разрабатываю. Я использую следующую команду из командной строки VS, работающей от имени администратора:
aspnet_regiis.exe -pef "Credentials" "C:\Users\.....\MyProjectFolderDir"
Это структура моего файла app.config:
<?xml version="1.0" encoding="utf-8" ?>
<config>
<configSections>
<section name="ApplicationSettings" type="sometype"/>
<section name="WebSettings" type="sometype"/>
<section name="Credentials" type="sometype"/>
<section name="SQLServerSettings" type="sometype"/>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<ApplicationSettings Mode="mymode"
FileSearchMode="myfilemode"
SubtractHoursDebugging="0"/>
<WebSettings WebApiServers=""
CredentialMethod="mymethod"/>
<Credentials
Domain="mydomain"
UserName="myusername"
Password="mypassword"/>
<SQLServerSettings
ConnectionString="Server=***********"/>
</config>
Однако я продолжаю получать следующую ошибку:
Раздел конфигурации шифрования... Раздел конфигурации «Учетные данные» не найден. Не удалось!
Как я могу заставить это зашифровать мой раздел?
"configuration is declared twice"
, поэтому я просто переименовал ее в config. - person Hooplator15   schedule 14.07.2016