Thursday, January 7, 2016

Fix - 'dbproviderfactories' section can only appear once per config file'. SQLPW is not installed

We tried to create a new data source in a brand new Visual Studio reporting service solution 2012. We got an error prompt.

SQLPW is not installed
'dbproviderfactories' section can only appear once per config file'.

After we clicked Ok button on the prompt, a data source is created without connection string. We cannot update the data source in connection string. Edit button next to the text field for the connection string is disabled.

I did some research on google and found that the error is due to a corrupted version of machine.config which is related to Dot Net Framework.

machine.config is located in two places and they are 32 and 64 bit version. On my computer, they are located in 

64 bit

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config

32 bit
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config 

The file is corrupted due to an extra tag highlighted in yellow.To fix the error, we will need to delete the extra tag.

Step 1 : Back up machine.config file in both location(Copy the file and paste in the same location, Machine- Copy.config will be created.
Step 2: Open a notepad as an administrator and open  machine.config file from 32 bit location
Step 3: Find dbproviderfactories


Step 4. Remove the extra tag and save it.

Repeat step 2 to 4 for machine.config 64 bit version.

Close your visual studio reporting soultion. Reopen it again. In my case, Edit button is working now.

Thank you for reading. Have a nice day!




No comments:

Post a Comment

How to add a Database to AlwaysOn Availability Group with four different options

To add a database to an existing AlwaysOn availability group, MS has given us four options to choose from Automatic seeding Full database an...