Laurent Hinoul

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.” - John F. Woods

How to solve DbProviderFactories section can only appear once per config file error

Once upon a time, there was a program called ‘Agresso’. It uses the .NET framework.

When I started the program and wanted to log in. I got the following error message: DbProviderFactories section can only appear once per config file error. -.-‘

After some research, I discovered it was a bug in the .NET framework. (not surprising me :p). Now, to solve this, do the following steps below.

First, go to C:\Windows\Microsoft.NET\Framework. There you can see different versions. First go to the folder v4.0.30319 and open the Machine.Config file in a text editor. In that file, search for the string “<DbProviderFactories/>”. If you found that you can see the following code:

The <DbProviderFactories/> doesn’t belong there so delete this line:

Save it and look in the other folders if the line is there too. It’s possible that this line also appears in v2.0.50727.

When I did this, the program worked like a charm. Enjoy!

9 comments for “How to solve DbProviderFactories section can only appear once per config file error

  1. JC
    18/03/2016 at 21:40

    I’m new to VS and to SSDTBI and this solution worked in my environment… Thanks!

  2. Denis
    31/05/2016 at 14:10

    Don’t forget to make the same for the Framework64 directory too ! It works well, thanks ! DS

  3. Angela M
    01/12/2016 at 07:04

    Great instructions… worked perfectly!

  4. 10/12/2016 at 20:49

    This works and corrects the problem with my DxO Optics Pro software.
    Thanks a lot!

  5. John
    06/02/2017 at 20:49

    Thank you so much. This fixed my problem. I was unable to install Google Drive for Microsoft Office and this was the only article I found that was related to the error I was getting.

  6. cass
    22/08/2017 at 20:58

    When i open the machine.config file it just gives me a blank grey screen?
    had it opened once but didnt have admin rights to delete the line. closed out to get admin rights now blank.

    Any suggestions?

  7. ibmh8
    01/12/2017 at 11:12

    this is not a bug in the .NET framework as you suggest. It’s the IBM data provider installation which messes up the machine.config.

  8. Oleg
    22/05/2018 at 11:35

    Thanks, man! It’s work like a charm!

  9. Ray
    08/08/2018 at 13:53

    Thanks, worked for me.
    I changed it in both Framework and Framework64. I wonder how it was added there in the first place

Leave a Reply to cass Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: