Share via


"The given key was not present in the dictionary" error when adding a data connection to a local database (sqlexpress 2008) in VS 10

Question

Wednesday, March 3, 2010 5:24 PM

Hi, I'm using Visual Studio 2010 Utimate (latest version, beta 2 I believe).

It was working for some time, and since about a week ago, without any (intentional) changes to VS settings, I am having problems connecting to the data base. I have a database running (sqlexpress 2008) on the same computer.

On the server explorer my connection to database under Data Connections appears with an (X) mark. When I try to refresh it I get a pop up saying "Server Explorer is unable to perfom this operation. See below for details:
Object reference not set to an instance of an object"

If I try to delete this connection,I get the error message
"The given key was not present in the dictionary"

If I try to create a new connection to my database (using Add Connection) I get
"Unable to add data connection. The given key was not present in the dictionary".
However, if I test connection to the database the test succeeds.

I've uninstalled VS 10 on my computer, clearted the registry entries for VS 10 and reinstalled it, but I'm still getting the same error.

Could someone pls help ?

Many thanks.

CL

All replies (18)

Friday, March 5, 2010 9:16 AM ✅Answered

Hello,

You may try the following steps to see if it helps:

a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

e)      Try to create a new user account. This can help isolate user profile corruption related causes.

In addition, Microsoft Visual Studio 2010 Ultimate RC has been released, you could get it from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a&displaylang=en

If this issue still exists, you could post your issue on the Preleased versions of Visual Studio Team System 2010 Forum to see if any community members have came across this issue and had any suggestions.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at [email protected].


Thursday, March 4, 2010 9:22 PM

Same error.


Monday, June 21, 2010 9:15 PM | 8 votes

I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

Works now.

 

 


Wednesday, July 14, 2010 1:08 PM

Worked like a charm for me as well.  Thanks a mil for the suggestion.


Thursday, September 16, 2010 7:45 AM

Worked perfectly for me too - the folder I removed was called

C:\Users\prifre\AppData\Local\Microsoft\VisualStudio\9.0

 

I wonder why the error appeared...

 

with a smile

/prifre


Thursday, January 13, 2011 2:27 PM

I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

Works now.

 

 

Thats Really works!!!!!!!!!!!!!!!!!!! 


Wednesday, June 29, 2011 1:38 PM

Hi

Reselved to select GConfiguration Property->debug to lounch, select local debugger

 


Tuesday, July 19, 2011 5:13 PM

Thank you kaletm.

Deleting the directory that you mentioned solved this problem for me.


Tuesday, July 26, 2011 6:18 AM

Hello,

You may try the following steps to see if it helps:

a)     Try to run devenv /ResetSettings (in command prompt) to eliminate the related potential settings problem.

b)     Try disabling Add-ins (e.g. “Tools” | “Add-in Manager”) or run “devenv.exe /SafeMode”.This can eliminate the possibility that third party Add-ins or packages are causing problems. (For more detailed VS command line switches information, see: http://msdn2.microsoft.com/en-us/library/xee0c8y7.aspx )

c)     Try creating a new project. Sometimes corrupted project settings can cause problems. These are project specific.

d)     Try to reboot the operating system to safe mode. This can help to isolate whether any other applications are interfering with Visual Studio. Note that some features (like IIS) are not available under safe mode. Please check whether this can be applied or not. In addition to safe mode, we can also try “clean boot”: How to configure Windows XP to start in a "clean boot" state http://support.microsoft.com/kb/310353 .

e)      Try to create a new user account. This can help isolate user profile corruption related causes.

In addition, Microsoft Visual Studio 2010 Ultimate RC has been released, you could get it from here:
http://www.microsoft.com/downloads/details.aspx?FamilyID=457bab91-5eb2-4b36-b0f4-d6f34683c62a&displaylang=en

If this issue still exists, you could post your issue on the Preleased versions of Visual Studio Team System 2010 Forum to see if any community members have came across this issue and had any suggestions.

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Send us any feedback you have about the help from MSFT at [email protected].

I have just started getting this error. I have tried a) b) c) in addition to deleting the directory that was listed in a later post.

The test connection is working for me as well, but after I click the OK button I get the error mentioned above.

I am using the Release version of Visual Studio 2010. 

Help. This just happened to me, and is killing my ability to work on things.


Wednesday, July 27, 2011 11:47 PM

I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

Works now.

 

 

This did NOT work for me!


Tuesday, November 8, 2011 8:59 AM | 3 votes

I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

Works now.

 

 

This did NOT work for me!

Deleting the local appdata path did not work for me either (Windows 7, VS2010), but roaming did!

So whereas deleting C:\Users\me>\AppData\Local\Microsoft\VisualStudio\10.0 did not work, deleting C:\Users\me>\AppData\Roaming\Microsoft\VisualStudio\10.0 did!

In my case, the culprit was that I had an old SQLite connection in the list, but had removed the provider.

 


Friday, January 13, 2012 8:13 AM

Hi, I confirm that removing roaming path (Win7 32bit, VS2010) did work for me. Very thanks.


Tuesday, February 14, 2012 12:41 PM

Thanks,

it work perfect for me, too (Win7/32b, VS2010)


Sunday, March 4, 2012 9:03 PM

Thanks,

it work perfect for me, too (Win7/32b, VS2010)

It worked for me as well.

Thank you for sharing the solution.

Problem : Error while trying to add a new database using Server Explorer in VS.NET 2010

Error        : The given key was not present in the dictionary

Solution : Remove forlder  : C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0


Sunday, April 8, 2012 5:38 PM

I was receiving this error as well.  I followed the above steps and discovered creating a new account resolved the error.  So to fix it for my account I deleted the folder

C:\Documents and Settings\USERNAME\Application Data\Microsoft\VisualStudio\10.0

Works now.

You're simply great.

Thank you.


Tuesday, April 10, 2012 4:35 PM | 1 vote

A less invasive approach is to delete: C:\Users\USERNAME\AppData\Roaming\Microsoft\VisualStudio\10.0\ServerExplorer\DefaultView.SEView

Shawn Camp


Thursday, November 22, 2012 6:44 AM

 This is working for me Thanks!


Monday, April 9, 2018 11:32 PM

So whereas deleting C:\Users\<me>\AppData\Local\Microsoft\VisualStudio\10.0 did not work, deleting C:\Users\<me>\AppData\Roaming\Microsoft\VisualStudio\10.0 did!

thanks really works.