Asked  6 Months ago    Answers:  5   Viewed   81 times

I've encountered an error deploying a site to a server. When trying to load the home page, or access authentication on the new site in IIS, I get the error:

Config Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

More detail can be found here, in Scenario 7 matches my hex error code.

The solution given on the linked site above is to set Allow for overrideModeDefault in the section mentioned in my error, in the applicationHost.config file. In my case, under Security in system.webServer. But if I look at the applicationHost.config on my local computer, where the site is properly deployed already, that section is set to Deny.

If this solution is correct, how is my local instance running just fine with the same web.config? According to my applicationHost.config, that section should be locked, but it's not. I'd prefer to not change the applicationHost.config file, because there are many other sites running on that server. Is there another solution?

 Answers

26

I had the same problem. Don't remember where I found it on the web, but here is what I did:

  • Click "Start button"
  • in the search box, enter "Turn windows features on or off"
  • in the features window, Click: "Internet Information Services"
  • Click: "World Wide Web Services"
  • Click: "Application Development Features"
  • Check (enable) the features. I checked all but CGI.

btw, I'm using Windows 7. Many comments over the years have certified this works all the way up to Windows 10 and Server 2019, as well.

Tuesday, June 1, 2021
 
Sendy
answered 6 Months ago
27

You need to bind loggedIn to the correct context. There are several options:

1) define loggedIn as bound function:

export class ContactComponent implements OnInit {
  loggedIn = () = > {
         this.redirect = "dashboard";
         console.log("success");`

2) use bind

export class ContactComponent implements OnInit {
  contactForm: FormGroup;
  errorMsg:string = '';
  redirect = "";

  loggedIn(): void {
         this.redirect = "dashboard";
         console.log("success");

    submitForm(): void {
        DBEventProxy.instance().dbevent.login(this.contactForm['username'], 
        this.contactForm['password'], this.loggedIn.bind(this), this.failed);
                                                    ^^^^^^^^^^
      }

3) wrap this.loggedIn into an arrow function that preserves context like this:

this.contactForm['password'], () => this.loggedIn(), this.failed);

And probably you want to do the same for this.failed. Read more about bind and arrow functions here

Saturday, July 31, 2021
 
peixotorms
answered 4 Months ago
88
  1. Go into the IIS site properties for the domain you're moving from. In the "Home Directory" tab, click the option "A redirection to a URL"
  2. In the Redirect to box, enter the domain you wish to move to (no trailing slash), plus $S$Q - for example, http://www.YourDomain.com$S$Q
  3. Next, check the options that state the client will be sent to "The exact URL entered above", and "A permanent redirection for this resource"
Sunday, August 8, 2021
 
123r789
answered 4 Months ago
78

This error cause when the section is locked at the parent level. you could follow below steps to unlock section at parent level:

1) In the connections tree(in IIS), select your website from the connection pane.

2) Select Configuration editor from feature view.

3) In the window that opens, on top, you will find a drop-down for sections. Choose "system.webServer/WebSocket" from the drop-down.

5) On the right side, there is another drop down. Choose "ApplicationHost.Config "

6) From Action pane, you will find "Unlock Section" under "Section" heading. Click on that.

7) Once the WebSocket at the applicationHost is unlocked, restart IIS and run site.

enter image description here

Regards, Jalpa

Monday, October 18, 2021
 
Martin Thoma
answered 2 Months ago
76

IIS_USRS is local group added with IIS 7 release. It isn't available on active directory so while searching it location should be selected as local machine name in "From this location" field. You should be able to find "IIS_USRS" group under your local machine.

Tuesday, November 2, 2021
 
koenHuybrechts
answered 4 Weeks ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :
 
Share