.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Articles >> SharePoint >> Post New Resource Bookmark and Share   

 Subscribe to Articles

Visual Studio Error: The given key was not present in the dictionary

Posted By:Dhiraj Ranka       Posted Date: March 13, 2011    Points: 200    Category: SharePoint    URL: http://www.dotnetspark.com  

This article describes how to handle when some one gets error like this "Could not load the Web.config configuration file. Check the file for any malformed XML elements, and try again. The following error occurred: The given key was not present in the dictionary"
 

While coding on one of our project in Visual Studio 2010 with SharePoint 2010, I got this error while deploying the project on SharePoint farm.

"Could not load the Web.config configuration file. Check the file for any malformed XML elements, and try again. The following error occurred: The given key was not present in the dictionary"

Now the point is that this message is not very specific about where we exactly got wrong or what key which is not present in the dictionary(web.config).

Best thing about this error is that its solution is very simple and its that you have to make sure that site URL's host you deploy your solution should be same as SharePoint's default alternate access mapping.

For example in SharePoint's Central Administration, Alternate Access Mappings you might have are

Internal URL Zone Public URL for Zone
http://machine-name:23567 
Default http://machine-name:23567
http://machine-name Default http://machine-name
http://localhost Custom http://localhost

If in Visual Studio's Properties window you have Site URL = http://localhost/ you get the error mentioned. But it will work with Site URL = http://machine-name.

Isn't it was simple :-)

Reference: http://msdn.microsoft.com/en-us/library/ee231594.aspx

 Subscribe to Articles

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More Articles on C#, ASP.Net, Vb.Net, SQL Server and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend