Applies to FlexLink Design Tool.

Sometimes a user encounter problems starting Design Tool with some strange exception message stating "The 'DbProviderFactories' section can only appear once per config file.". This comes from the fact that IBM DB2 installs a faulty configuration into some system data which means that Windows/.NET cannot add other database configurations to it without breaking the configuration file.

Symptoms:

User cannot start Design Tool and the below exception is displayed.

Guide to fix:

Apparently this is a known issue with the IBM DB2 software that installs its own database driver. This unfortunately corrupts two of the machine.config files so they can no longer be appended. In order to solve this, you need to open the corrupted files and remove a line. Apparently this is fixed by installing an update of the IBM DB2 software, but I have not found any such right now.

To be able to fix this manually, you need to have administrator access on your machine, otherwise you will have one of your administrators to correct this on your machine.

When you have administrator access, follow the below guide to correct this:

  1. Open each file below in Notepad or similar text editing tool (make sure it can write to the file)
    1. C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config
    2. C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config
    3. C:\Windows\Microsoft.NET\Framework64\v2.0.50727\CONFIG\machine.config
    4. C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config
  2. In each file search for the text “<DbProviderFactories/>” (should be around line 156)
    1. If you cannot find it, the file is fine and continue with the next file
    2. If you find it, remove the text and save the file

More information can be found here:

Exception:

ERROR VisualComponents.UX.Shell.AppBootstrapper [(null)] - UnhandleException (OnUnhandledException) (GetLastError = 0) System.Configuration.ConfigurationErrorsException: The 'DbProviderFactories' section can only appear once per config file.
at System.Configuration.BaseConfigurationRecord.EvaluateOne(String[] keys, SectionInput input, Boolean isTrusted, FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult)
at System.Configuration.BaseConfigurationRecord.Evaluate(FactoryRecord factoryRecord, SectionRecord sectionRecord, Object parentResult, Boolean getLkg, Boolean getRuntimeObject, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at System.Configuration.BaseConfigurationRecord.GetSection(String configKey)
at System.Configuration.ConfigurationManager.GetSection(String sectionName)
at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName)
at System.Data.Common.DbProviderFactories.Initialize()
at System.Data.Common.DbProviderFactories.GetProviderTable()
at System.Data.Entity.Infrastructure.SqlCeConnectionFactory.CreateConnection(String nameOrConnectionString)
   at VisualComponents.eCatalogue.DataModel.Data.eCatalogueStoreDataContext..ctor()