If you want to connect to the localdb instance on a developer pc with Microsoft SQL Server Management Studio use:





If you want to only reload css and not the entire page, when files change on disk, you can use the following gulp file.


/** * When you want to use this gulpfile.js, make sure you execute the gulp.ps1 PowerShell script first, so everything is installed correctly. */ (function (require) { "use strict"; // Gulp. var gulp = require("gulp"); // Gulp plugins. var plumber = require("gulp-plumber"); var livereload = require("gulp-livereload");

// Gulp plumber error handler var onError = function (err) { console.log(err); }; /** * The following file will be reloaded, when one of the "watched" *.html or 8.js files has changed. */ gulp.task('reload', function () { gulp.src([ "App/unit.test.runner.html" ]) .on('error', onError) .pipe(gulp.dest('dist')) .pipe(livereload()); }); /** * All *.css files will be reloaded, when one of the "watched" *.css files has changed. */ gulp.task('reloadCss', function () { gulp.src([ 'App/**/*.css' ]) .on('error', onError) .pipe(gulp.dest('dist')) .pipe(livereload()); }); /** Watch *.css files, but only reload css, not the entire page. Watch *.html and *.js files, when a change is detected, reload the whole page. */ gulp.task("watch", function () { livereload.listen(); gulp.watch([ "App/**/*.css" ], ["reloadCss"]); gulp.watch([ "App/**/*.html", "App/**/*.js" ], ["reload"]); }); /** When the user enters "gulp" on the command line, the default task will automatically be called. This default task below, will run all other task automatically. So when the user enters "gulp" on the command line all task are run. */ gulp.task("default", ["watch", "reload"]); }(require));

Tags: ,

Roel van Lisdonk on November 23rd, 2015




If you use the standard HTML reporter for jasmine an expect like:


would result in:



If you replace the div tag with a pre tag in the “jasmine-html.js” file.




and use the third paramater of the JSON.stringify method to pretty print the JSON,


expect(JSON.stringify(actual, null, 4)).toEqual(JSON.stringify(expected, null, 4));


the result will be:



In some cases this will simplify, spotting the error in the JSON result.

Tags: ,

Roel van Lisdonk on November 10th, 2015

When I created an new project with the Node.js tools for Visual Studio 2015, and set a breakpoint in my app, this breakpoint would never be hit.


The fix, first make sure, not other debug sessions are running, second make sure you have installed the “Node.js Tools 1.1 RC3 for Visual Studio 2015".

Tags: ,

Let’s assume we have the class [GuidGenerator] in a TypeScript module [research.my.long.namespace] and at runtime you have an instance of the GuidGenerator, how do you get the full class name including module name, in this case: “research.my.long.namespace.GuidGenerator”.

Well you walk the object graph starting with the root / global object, in the browser this will be the window object.


NOTE: all code is in “strict” modus.


TypeScript Class [GuidGenerator]:

module research.my.long.namespace {
    "use strict";

    export interface IGuidGenerator {
        generate(): string;

    export class GuidGenerator implements IGuidGenerator {
        generate() {
            var randomNumberToGuid = function (c) {
                var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;
                return v.toString(16);
            return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, randomNumberToGuid);

We use the resolver object to get the full class name:

var resolver = new NameResolver();
var generator = new research.my.long.namespace.GuidGenerator();
var name = resolver.getFullClassNameFromInstance(generator, window)



The resolver class

module research.metadata {
    "use strict";

    interface IProcessResult {
        fnFound: boolean;
        path: Array<string>;

    export interface INameResolver {
        getFullClassNameFromInstance(instance: any, global: any): string;

    export class NameResolver implements INameResolver {
        private _fn: any;
        private _global: any;
        private _processed: Array<any>;

            To handle recursiveness in the object graph, collect all handled nodes in the object graph,
            so an object is only traversed once.
        isProcessed(obj: any): boolean {
            var result = false;
            for (var i, length; i < length; i += 1) {
                if (this._processed[i] === obj) {
                    return true;
            return result;

        processProperty(obj: any, key: string, path: Array<string>): IProcessResult {
            var result: IProcessResult = {
                fnFound: false,
                path: path

            if (obj.hasOwnProperty(key)) {
                try {
                    var prop = obj[key];
                    if (prop === this._fn) {
                        // Function found, stop traversing the object graph.
                        result.fnFound = true;
                        return result;
                    // Continue traversing the object graph.
                    result = this.processObject(prop, path);

                    if (result.fnFound) {
                        // Function found, stop traversing the object graph.
                        return result;
                } catch (error) {
                    // Access to some properties result in exceptions.

            return result;

        processObject(obj: any, path: Array<string>): IProcessResult {
            var result: IProcessResult = {
                fnFound: false,
                path: path

            if (this.isProcessed(obj)) {
                return result;
            for (var key in obj) {
                var pathCopy = path.slice();
                var processResult = this.processProperty(obj, key, pathCopy);
                if (processResult.fnFound) {
                    return processResult;

            return processResult;

        getFullClassNameFromInstance(instance: any, global: any): string {
            this._fn = instance["constructor"];
            this._global = global;
            this._processed = [];

            var processResult = this.processObject(this._global, []);

            var fullFnName = "";
            if (processResult.fnFound) {
                fullFnName = processResult.path.join(".");

            return fullFnName;


Roel van Lisdonk on October 27th, 2015

If you sign in to a Windows 10 pc by using a Microsoft account. e.g. myaccount@outlook.com , then you can connect with remote desktop to this pc, by using the user name: microsoftaccount\myaccount@outlook.com.

Tags: ,

Roel van Lisdonk on October 21st, 2015


A good screencast on RequestAnimationFrame, this is what will drive the performance of modern ui web frameworks.




Very interesting: https://gridstylesheets.org/:


Soon after the W3C introduced Cascading Style Sheets, Greg Badros, the author of the Cassowary Constraint Solver & recently retired Facebook VP, proposed Constraint CSS (CCSS) as a general solution for CSS layout. Back in ’99 Badros demonstrated responsive layouts with CCSS that today’s designers still can’t reproduce without grinding out piles of JavaScript. For more than a decade, no one seemed to take notice outside of academia until Apple implemented Cassowary & Greg’s pioneering concepts in its new AutoLayout engine with the launch of OS X Lion. Despite the evolutionary leap for app developers, web designers have had to settle with float-based & table-based layouts that have remained unimproved to this day.


Some examples:



Roel van Lisdonk on October 19th, 2015

Just a reminder beta 8 for ASP .NET is out:



If you don’t install this tooling, you will get an error (see below), when manual upgrading from beta 5 to 8 in the project.json file.

Don’t forget to set the Solution DNX SDK version of your project to 1.0.0-beta8.




Also make sure you set the default document, when using only static files and target the .NET Core runtime.





Server Error in ‘/’ Application.

Could not load file or assembly ‘Microsoft.Dnx.Host.Clr’ or one of its dependencies. The system cannot find the file specified.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.IO.FileNotFoundException: Could not load file or assembly ‘Microsoft.Dnx.Host.Clr’ or one of its dependencies. The system cannot find the file specified.
Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Assembly Load Trace: The following information can be helpful to determine why the assembly ‘Microsoft.Dnx.Host.Clr’ could not be loaded.

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.Dnx.Host.Clr
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Microsoft.Dnx.Host.Clr | Domain ID: 3
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/Users/roel/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta5/bin
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
LOG: This bind starts in default load context.
LOG: Configuration file C:\Program Files (x86)\IIS Express\iisexpress.exe.config does not exist.
LOG: No application configuration file found.
LOG: Using host configuration file: C:\Users\roel\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Users/roel/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta5/bin/Microsoft.Dnx.Host.Clr.DLL.
LOG: Attempting download of new URL file:///C:/Users/roel/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta5/bin/Microsoft.Dnx.Host.Clr/Microsoft.Dnx.Host.Clr.DLL.
LOG: Attempting download of new URL file:///C:/Users/roel/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta5/bin/Microsoft.Dnx.Host.Clr.EXE.
LOG: Attempting download of new URL file:///C:/Users/roel/.dnx/runtimes/dnx-clr-win-x86.1.0.0-beta5/bin/Microsoft.Dnx.Host.Clr/Microsoft.Dnx.Host.Clr.EXE.

Stack Trace:

[FileNotFoundException: Could not load file or assembly 'Microsoft.Dnx.Host.Clr' or one of its dependencies. The system cannot find the file specified.]

[TypeLoadException: The domain manager specified by the host could not be instantiated.]
   System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException) +303

[HttpException (0x80004005): The domain manager specified by the host could not be instantiated.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9922864
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +90
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +261

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:


Roel van Lisdonk on October 15th, 2015


OpenSource en crossplatform

Is de toekomst, maar waarom krijg je dat van Microsoft en partners te horen? Daar is 1 reden voor bij Microsoft:

We want your FOR loop!!!

Wij (microsoft) verkopen compute, wij willen jouw code draaien, windows is afgeschreven als cach cow.


Windows containers

Kan zeer goed gebruikt worden voor immutable infrastructure



  • Virtual Machines (opstarten in minuten, grote: zo groot als de software die je erin zet + volledige operating system)
  • Containers (opstarten in seconden, grote: zo groot als de software die je erin zet)
  • Virtual processen, zoals in GO, Erlang / Elixer ( in 1 ms opgestart, grote: +/- 4kb) = performance niet normaal :-)


User Experience


JavaScript – Fetch API

De opvolger van XMLHttpRequest,


The Fetch API provides an interface for fetching resources (e.g., across the network.) It will seem familiar to anyone who has used XMLHttpRequest, but the new API provides a more powerful and flexible feature set.



  • geen bundeling meer nodig
  • geen image spriting meer nodig
  • Standaard TLS
  • Perfomance verbetering die behoorlijk kan oplopen van 50% tot 400%, zie https://http2.akamai.com/demo
  • Server push
  • Er wordt nog maar 1 verbinding gelegd en behouden, waarover gecommuniceerd wordt via onder andere multiplexing, frames hebben een ID.
  • Prioriteit geven aan bepaalde data in bepaalde situaties
  • Voor IIS beschikbaar in windows 10 / server 2016



  • Iterators
  • Generators
  • Template strings, let op je kunt waardes een stukjes tekst indexed, benaderen als je functie gebruikt bijv.: let items = test `${user.firstName} ${user.lastName}` let op de functie "test" wordt dan dus zonder haken aangeroepen, de test functies kan dan een values parameter hebben, waar de twee waardes in staan, lees meer op MDN.
  • Destruction
  • Symbol (kan gebruikt worden voor private members).
  • Lamda (=>) heeft lexical scope, this je kunt altijd this. Gebruiken, zonder let self = this; of function.bind the gebruiken.
  • … = rest parameter, maar kan ook spread operator zijn, ligt eraan waar hij staat
  • Defaults voor parameters
  • Gebruik for(item of items) als vervanger van for(var i = 1; length; i < length; i+=1) { }, indien index niet van belang is.

JavaScript libraries die tegenwoordig gebruikt worden rondom modules:

  • Babel.js
  • Core.js
  • TypeScript
  • JSPM
  • System.js (kan conditional lazy, modules laden)
  • Webpack
  • Browserify
  • Bower
  • NPM

Allemaal hebben ze wat overlap, maar doen ze allemaal net wat anders.



  • TypeScript (gebruiken als je typesafety belangrijk vindt, anders babel.js gebruiken)
  • Babel.js
  • Traceur (niet gebruiken)


  • Naar lage loonlanden, is in vele gevallen, vele male duurder, dan zelf bouw of outsourcing in eigen land.


Scaffolding tool

http://yeoman.io/ het is krachtig om code / projecten te genereren, volgens mij gaat microsoft zelf hier ook gebruik van maken in Visual Studio.


Handige sites


ASP.NET 5 op ASP .NET Core (DNX) is de toekomst voor wat betreft ASP .NET



En dan zijn er nog tal van zaken die op mijn uitzoeklijst zijn terecht gekomen: