0

Hi all,

This is a very elementary question, but I'm a couple of days into this. Which web.config file should one store keys in? Keys to use within a Model/Controller? I see four different ones:

Project > Views > Web.config
Project > Web.config
Project > Web.config > Web.Debug.config
Project > Web.config > Web.Release.config

When testing with a key in the one located Project > Views, I don't get to see the key value using ConfigurationManager.AppSettings.Get("UserName");.

Thanks.

2
Contributors
4
Replies
20
Views
1 Year
Discussion Span
Last Post by RudyM
0

Thanks, but what is the point of the others then? I also tried WebConfigurationManager.AppSettings.Get("UserName"); thinking this might get it from a different web.config, but not the case. Can I assume that using the second web.config in my list is the standard file to use for storing keys to be used in models and controllers?

Edited by RudyM: Added detail.

0

@pritaeas, that was an interesting read indeed. Thanks for that.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.