Error: Unrecognized attribute 'configBuilders'

0

I am deploying a .NET Web application to AWS via Elastic Beanstalk. My application uses AWS Secrets Manager for application settings and connection strings. I am achieving this using a custom configuration builder. I am able to deploy from Visual Studio successfully, however the deployment in Elastic Beanstalk fails. Looking at the event logs I see:

enter image description here

If I look at the logs, I see the following error

ERROR 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Exception during deployment. System.Runtime.InteropServices.COMException (0x8007000D): Filename: \?\C:\inetpub\wwwroot\web.config Line number: 33 Error: Unrecognized attribute 'configBuilders' at Microsoft.Web.Administration.Interop.IAppHostAdminManager.GetAdminSection(String bstrSectionName, String bstrPath) at Microsoft.Web.Administration.Configuration.GetSectionInternal(ConfigurationSection section, String sectionPath, String locationPath) at AWSBeanstalkCfnDeploy.Container.SetLocalEnvironmentVariables() in C:\Users\tainh\Documents\workspace\iiscore\src\EBDPT-IISCore\AWSBeanstalkCfnDeploy\Container.cs:line 253 at AWSBeanstalkCfnDeploy.DeploymentUtils.deployPackage(Container container, Boolean sync) in C:\Users\tainh\Documents\workspace\iiscore\src\EBDPT-IISCore\AWSBeanstalkCfnDeploy\DeploymentUtils.cs:line 158 at AWSBeanstalkCfnDeploy.DeploymentUtils.UpdateApplicationVersion(Container container, Boolean sync) in C:\Users\tainh\Documents\workspace\iiscore\src\EBDPT-IISCore\AWSBeanstalkCfnDeploy\DeploymentUtils.cs:line 56 2020-09-18 10:32:54,802 ERROR 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Unexpected Exception: System.Exception: Exception during deployment. ---> System.Runtime.InteropServices.COMException: Filename: \?\C:\inetpub\wwwroot\web.config Line number: 33 Error: Unrecognized attribute 'configBuilders'

My Web.Config file looks like this

      <configSections>
        <section name="configBuilders"
          type="System.Configuration.ConfigurationBuildersSection, System.Configuration, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
          restartOnExternalChanges="false" requirePermission="false"/>
      </configSections>
      <configBuilders>
        <builders>
          <add name="ProductionStore" mode="Greedy" type="Configuration.SecretsManagerConfigurationBuilder, Configuration"/>
          <add name="ProductionConnectionStringStore" type="Configuration.SecretsManagerConfigurationBuilder, Configuration"/>      
        </builders>
      </configBuilders>
      <connectionStrings configBuilders="ProductionConnectionStringStore">
          <add name="ApplicationServices" connectionString=""
      providerName="System.Data.SqlClient"/>
      </connectionStrings>
      <appSettings configBuilders="ProductionStore">
      </appSettings>

If I run this locally everything works fine.

c#
.net
amazon-web-services
amazon-elastic-beanstalk
asp-net-config-builders
asked on Stack Overflow Sep 18, 2020 by Peuge

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0