Hi! I'm Martin Söderlund, the owner of this blog. I work as a web consultant in Stockholm, Sweden. My main focus areas are .NET development and interface development.
If you've got something on your mind, feel free to contact me.


Thank you for visiting!

Please consider subscribing to the RSS feed or following me on Twitter.

Service Unavailable after Windows 10 Update

After updating to Windows 10 Fall Creators update, we encountered the Service Unavailable 503 message on our IIS websites.

The error looks like this:

The worker process for application pool 'APP_POOL_NAME' encountered an error
'Cannot read configuration file ' trying to read configuration data from file '\?\',
line number '0'. The data field contains the error code.

A solution that worked, is this:

  1. Stop the IIS - run iisreset /stop command in your command prompt.
  2. Remove everything in the c:/inetpub/temp/apppools folder. If you can't, look below for a few PowerShell commands you need to run.
  3. Start the IIS - run iisrest /start command in your command prompt.
  4. Make sure all your IIS app pools are running.
If you can't remove the files in the apppools folder, use Windows PowerShell to stop two services:
  1. Stop-Service -Force WAS.
  2. Stop-Service W3SVC.
  3. Remove apppols folder files.
  4. Run Start-Service W3SVC.


Repeat Every 6th Element Pattern With nth-child

Let's say you've got a set of elements where you want to match a pattern and give every other three a different style, illustrated like this:

Repeat every 6th pattern

Enter CSS3's nth-child. Repeat every 6th element pattern, like this:

li:nth-child(6n+6) {

Real Error Messages from IIS

If you want real error messages for your web application in the development environment, make sure you do this:


  1. Go to your web application under Sites and choose .NET Error Pages in the right pane.
  2. Click Edit Feature Settings in the most right pane.
  3. Make sure Mode is set to Off:
    IIS: Error Pages Off

In Web.Config:

Make sure the following httpErrors element is in the <system.webServer> node for the application, with errorMode set to Detailed and existingResponse set to PassThrough:

<httpErrors errorMode="Detailed" existingResponse="PassThrough">
    <remove statusCode="404" subStatusCode="-1" />
    <error statusCode="404" path="/404" responseMode="ExecuteURL" />

The 404 handling in above code is just for good measure.

Now you should once again get real .NET error messages from IIS.

Angular Delay with Debounce

Recently we were trying out a few things to delay validation of form fields in our Angular application. The not so good solution, was this:

<input type="text" ng-keyup="validate()" />

As soon as a keyboard key was released, the validate method was triggered. A little bit too often.

So we wanted something that created a delay in our validation. You could add a timeout handler in the validate function, but it wouldn't help, as the validate method would be called numerous times anyway, but with a delay.

In steps ng-change and ng-model-options with debounce. This is Angular 1.5.8. The new code that works really well:

<input type="text" ng-change="validate()" ng-model-options='{ debounce: 1000 }' />

This creates a delay of 1000 ms before the validate method is triggered.

Angular 2 version

Use RxJs Observables and the debounceTime() operator. Here's a good Stack Overflow thread on Angular 2 and debounceTime. In short, the pseudo code looks like this:

             .subscribe(term => this.wikipediaService.search(term).then(items => this.items = items));

Further reading here.

To the top