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

Leave a Reply to JC Cancel reply

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

%d bloggers like this: