« Previous Next »

Thread: section.OverrideMode = OverrideMode.Allow; ----> "The request is not supported"

Last post 07-10-2009 9:56 PM by diegochb. 4 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (5 items)

Sort Posts:

  • 07-07-2009, 2:47 PM

    section.OverrideMode = OverrideMode.Allow; ----> "The request is not supported"

    ErrorCode: -2147024846
    Source: "Microsoft.Web.Administration"

     Code: (s is the location/IIS7 site name)

    Configuration config = mgr.GetWebConfiguration(s);
    Configuration appHostConfig = mgr.GetApplicationHostConfiguration();
    if (chbSetting1.Checked)
    {
        ConfigurationSection section = appHostConfig.GetSection("system.web/globalization", s);
        section.OverrideMode =
    OverrideMode.Allow;
        mgr.CommitChanges();
    }

    Is there another way to allow the override mode of a section? 

     

  • 07-10-2009, 8:51 AM In reply to

    Re: section.OverrideMode = OverrideMode.Allow; ----> "The request is not supported"

    What would be the way to do

    %systemroot%\system32\inetsrv\AppCmd lock config "sitename" /section:system.web/globalization /commit:machine

    With C#? Basically my concern is the /commit:machine to ensure it does it at the applicationHost.config at least....

    Thank you

  • 07-10-2009, 5:35 PM In reply to

    Re: section.OverrideMode = OverrideMode.Allow; ----> "The request is not supported"

    Your code above should work:

    Configuration appHostConfig = mgr.GetApplicationHostConfiguration();
    ConfigurationSection section = appHostConfig.GetSection("system.web/globalization", s);
    section.OverrideMode =
    OverrideMode.Allow;
    mgr.CommitChanges();

    Is that not the case?

  • 07-10-2009, 5:36 PM In reply to

    Re: section.OverrideMode = OverrideMode.Allow; ----> "The request is not supported"

    I just saw the problem right after posting it :), we are doing this in AppHost, but it should be in root web.config

    Configuration rootConfig = mgr.GetWebConfiguration(null);
    ConfigurationSection section = rootConfig.GetSection("system.web/globalization", s);
    section.OverrideMode =
    OverrideMode.Allow;
    mgr.CommitChanges();

    Is that not the case?

  • 07-10-2009, 9:56 PM In reply to

    Re: section.OverrideMode = OverrideMode.Allow; ----> "The request is not supported"

     Thanks! I will have to wait until monday to test it :( !

Page 1 of 1 (5 items)
Microsoft Communities