Error “… The given key was not present in the dictionary.” When Deploying SharePoint 2010 Solutions From Visual Studio

You try to deploy a SharePoint 2010 solution from Visual Studio 2010 and receive the following error:

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 the message isn’t very specific on what key wasn’t present in which dictionary it’s at least unique so you can find posts like this :-).

And even better–it has a simple solution: make the site URL’s host you deploy your solution to match SharePoint’s default alternate access mapping.

For example in SharePoint’s Central Administration, Alternate Access Mappings you have

Internal URL Zone Public URL for Zone
http://MyMachine:42442 Default http://MyMachine:42442
http://MyMachine Default http://MyMachine
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://MyMachine.

This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s