views:

27

answers:

3

In ASP.Net when I see the error message "The entry 'x' has already been entered" I think that means a name (in this case 'x') is defined twice in Web.Config.

Is that a reasonable summary of what causes that error or are there other ways it could be generated ?

The 'x' in question doesn't appear twice in the web.config - any ideas of what else could be causing this error ?

+2  A: 

It could be you have nested Web.configs. If you're running more than one application out of the same directory hierarchy you might see this. For example, say you've got IIS pointed at the root of some directory, but inside that directory is a folder with another app in it and you have a vdir pointed to that app - well you may indeed run in to this problem as ASP.Net will parse the web.config at the root first, and then the web.config for the application the vdir points to.

Eric
A: 

+1 to Erics answer. Also if you upgrade web projects (i.e. from VS 2008 to VS 2010) the web.config file it keeps for you in the backup folder will cause this error for the same reason.

BrokenGlass
A: 

I've seen this happen where the virtual directory inherited settings from the root site. Check to see if another web.config at the parent level does not also contain the AppSettings key.

MikeW