I am running a .NET 4.0 Web Application. Under IIS Express ( and only IIS Express ) none of my APPSettings are read into the AppSettings collection. When I look into this collection it is empty even though I have about 15 app settings in the web.config. Any sugguestions on what is going on?
This is a Web Application project. I am usi开发者_如何学编程ng web.config transformations but I believe those only are used when publishing.
One thing I've discovered that can cause appsettings not to load this is having a virtual directory nested in another directory
http://localhost:8181/xproject/mysite
changing it to
http://localhost:8181/xproject_mysite
fixed it for me.
I have no idea why though.
Make sure that the the appSettings element in the web.config is a child element of the configuration element.
精彩评论