Saturday, 14 March 2015

Sbt template to setup scala multi-project build with dependencies

GitHub project 'sbt-multiproject-template'

Tuesday, 18 November 2014

SQL Server User-Defined Table Type

Tuesday, 21 October 2014

Scala Option Type

The Neophyte's Guide to Scala Part 5: The Option Type by Daniel Westheide

Thursday, 9 October 2014

SQL Server Isolation Levels By Example

SQL Server Isolation Levels By Example

Wednesday, 8 October 2014

SQL Server refresh all views & stored procedures

Thursday, 6 March 2014

Scala Play Framework json case class example

Wednesday, 30 October 2013

How to enable Kerberos Delegation in Google Chrome

* Using Registry Key

Set/Add this string registry key

Name: AuthNegotiateDelegateWhitelist
Value: *

* Using Command Line param


Delegation can be restricted to servers in the specific domain


I’ve tested it with IIS + SQL Server and double hop delegation works fine.

You can read more about Google Chrome command line params here.

Tuesday, 22 October 2013

Remote debugging IIS Web Application from Visual Studio

Setup your debug environment as described in Remote debugging from Visual Studio post.

When you click ‘Attach’ select w3wp.exe process. If you’re running Application Pools with multiple version of .Net you might see more than one process so make sure you select the correct one.

DelegConfig Kerberos Delegation Configuration Reporting Tool by Brian Murphy-Booth

DelegConfig is an ASP.Net application to test Kerberos/Delegation configuration on your IIS & SQL Server. Useful for testing double hop authentication issues.

IIS Windows Authentication/Delegation issue with C# Parallel Tasks

When you use double-hop authentication (WebBrowser->IIS->SQL Server) code executed on the webserver inside Parallel.Invoke() or Task.Factory.StartNew() is no longer executed as authenticated user (domain\username) but is being changed to (domain\iisservername$). You can see it in Environment.UserName when debuging. So if you're executing any SQL queries as Tasks you might get permission denied errors.

The way to fix it is to pass custom TaskScheduler from CurrentSynchronizationContext

  new ParallelOptions()
    TaskScheduler = TaskScheduler.FromCurrentSynchronizationContext()
  () => { /*do something here;*/ },
  () => { /*do something here;*/ }, 

This is a good article about SynchronizationContext It's All About the SynchronizationContext