I'm trying to enable anonymous access on an application in IIS7, using the code below:
ConfigurationSection config = server.GetWebConfiguration(webSiteName).GetSection("system.webServer/security/authentication/anonymousAuthentication", "/" + applicationName);
config.OverrideMode = OverrideMode.Allow;
config["enabled"] = true;
However I'm getting this error:
Failed: The request is not supported. (Exception from HRESULT: 0x80070032)
How can I modify anonymous access for the application?
Thanks, ng93