Joshua Hudson
Joshua Hudson

Reputation: 2217

IIS Express No AppSettings

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 using web.config transformations but I believe those only are used when publishing.

Upvotes: 3

Views: 1676

Answers (2)

jbtule
jbtule

Reputation: 31809

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.

Upvotes: 5

Craig
Craig

Reputation: 7076

Make sure that the the appSettings element in the web.config is a child element of the configuration element.

Upvotes: 0

Related Questions