Search code examples
wcfiis-7entity-framework-4machine.config

The 'DbProviderFactories' section can only appear once per config file


We are receiving this error when calling a WCF .net 4.0 service using entity framework.

The 'DbProviderFactories' section can only appear once per config file

It is the first app on the server using EF and other .net 4.0 WCF services are not receiving this error.

Is there any way to correct this error with out editing the machine config file on the server?


Solution

  • Maybe you could create web.config entries which override any machine-wide settings you want changed.

    Described here:

    Override machine.config by web.config

    Putting the <clear /> instruction inside of the DbProviderFactories tags in the web config to clear out and then override the duplicate entries made in the machine config. Thus doing a hack-work around of the error in the machine.config.