I can configure encryption of connection strings using the aspnet_regiis.exe command. Now I have created a configuration section to which the Custom Custom Element Collection is added, and this will save the value of the connection information.
namespace ExpressSnapSortCreation {
This is the partition creation code
class ServerReplications : ConfigurationSection {
This is my application configuration file.
<?xml version="1.0"?> <configuration> <configSections> <section name="ReplicationConfigurationSection" type="ExpressSnapSortCreation.ServerReplications, ExpressSnapSortCreation" /> </configSections> <ReplicationConfigurationSection> <ReplicationDataBases> <add name="ApplicationServices" connectionString="Data Source=PC-002\SQLEXPRESS2014;Initial Catalog=AML25;Persist Security Info=True;User ID=sa; Password=StItS!@ #SeRvErPC-003" providerName="System.Data.SqlClient" order="1" /> <add name="ApplicationServices2" connectionString="Data Source=PC-004\SQLEXPRESS2014;Initial Catalog=AML26;Persist Security Info=True;User ID=sa; Password=StItS!@ #SeRvErPC-002" providerName="System.Data.SqlClient" order="2" /> </ReplicationDataBases> </ReplicationConfigurationSection> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1"/> </startup> </configuration>
In the application, we get the value of the connection string. Due to a security purpose, we cannot display data in the App.config file. then you need to encrypt the section below
Got Error Converting the file name "app.config" to "Web.config"
An error occurred while creating the configuration section handler for ReplicationConfigurationSection: the file or assembly "ExpressSnapSortCreation" or one of its dependencies could not be loaded. The system cannot find the specified file. (C: \ Users \ mukesh.singh \ Documents \ Visual Studio 2015 \ Projects \ AML \ ExpressSnapSortCreation \ bin \ Debug \ web.config line 4)
Failed to load file or assembly "ExpressSnapSortCreation" or one of its dependencies. The system cannot find the specified file. Error!
- After change
Failed to load type 'ExpressSnapSortCreation.ServerReplications' from assembly' System.Web, Version = 4.0.0.0, Culture = Neutral, PublicKeyToken = b03f5f7f11d50a3a ".
I also tried this combination
aspnet_regiis.exe -pef "ExpressSnapSortCreation.ServerReplications/ExpressSnapSortCreations" "C:\Users\mukesh.singh\Documents\Visual Studio 2015\Projects\AML\ExpressSnapSortCreation
source share