Search code examples
asp.netweb-configiis-express

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.


Solution

  • 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.