1

We have a requirement of encrypting the connection string of a Sitecore application with some external database entries in connectionstring.config file. We are using the below command to perform this operation-

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>Aspnet_regiis.exe -pef "connectionStrings" "C:\Encryption"

Where C:\Encryption is our path of the website root. but we are getting below error while running this command -

Microsoft (R) ASP.NET RegIIS version 4.0.30319.0 Administration utility to install and uninstall ASP.NET on the local machine. Copyright (C) Microsoft Corporation. All rights reserved. Encrypting configuration section... An error occurred loading a configuration file: Could not load file or assembly 'Microsoft.Configuration.ConfigurationBuilders.Environment, Version=1.0.0.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified. (D:\temp\test\App_Config\ConnectionStrings.config)

Could not load file or assembly 'Microsoft.Configuration.ConfigurationBuilders.Environment, Version=1.0.0.0, Culture=neutral' or one of its dependencies. The system cannot find the file specified. Failed!

enter image description here

how to fix this?

1 Answer 1

3

After investigating, I found that Sitecore's Connection string uses a configBuilders attribute.

<connectionStrings configBuilders="SitecoreConnectionStringsBuilder">
 ......
</connectionStrings>

The encryption command tries to resolve this configBuilders on the on-premise server, to fix this issue, we need to remove this attribute with value (configBuilders="SitecoreConnectionStringsBuilder") before performing the encryption command. So our connection string should be like the below -

<connectionStrings>
 ......
</connectionStrings>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.