Skip to main content


Showing posts from October, 2015

Combining Kendo UI–Grid with Angular.js–Pass selected item to controller

A colleague couldn’t find a clean solution to pass the selected row in a Kendo Grid to an Angular controller method. So here is a short code snippet that shows how this can be done: Here is the UI(admire my great design skills): Here is the corresponding HTML and Angular controller:

Angular–Strange ng-click issue

A colleague asked me to have a look at the following issue he had: “I have the following problem inside my Angular application: I’m using the ngclick to capture the click event on a link and call a method on my controller that uses the UI routing to navigate to a different page inside my SPA. However when I click on the link, the navigation occurs as expected but I also see that the URL in my address bar is set to the root domain. To give an example, instead of showing, the url is reset to”   And here is the code he was using: When I started to debug the problem, I noticed that 2 click events were triggered when you click on the link. The first click event handles the ng-click as you would expect but the second click executes the normal action when clicking on a url(in this case, as the href attribute was empty, it triggers a navigation to the root url, explaining the strange behavior in the address bar). I was able to fix the issue, b

What’s a secure password?

As a consultant I visit a lot of companies. At most of these companies I have an account and associated password. Every company has it’s own set of password rules most of the time expecting a combination of letters, numbers, uppercase, lowercase and special characters. But how useful are these password policies and in what ways does it help to make my password hard to crack? There are a lot of misconceptions regarding passwords and what a lot of people think is a secure password in the end is not. For example, do you think that “P@ssw0rd1!” is a more secure password than “This is my password” ? (At least what I know, is that the second one is a lot easier to remember.) Let’s use Haystack to get the answer: “Haystack is an interactive brute force search space calculator that allows you to experiment with password length and composition to develop an accurate and quantified sense for the safety of using passwords that can only be found through exhaustive search.” First che

TFS 2015–Visual Studio Test Runner

After upgrading a XAML build template to TFS 2015, some of our unit tests started to fail. I had no idea what was causing the issue, so I tried to enable any kind of logging I could. I knew that behind the scenes the Build agent was calling the vstest.console.exe, but no matter what I tried I noticed that I couldn’t find the exact parameters that were used to call this test runner . I’m not the only one who had this problem, as an issue had already been raised on Uservoice, . Remark: Maybe another good reason to upgrade to the new Build system in TFS 2015, as the Visual Studio Test step nicely logs the exact parameters.

F#–Day by Day

In my journey to master the ancient art of functional programming, I found the F# Day by Day repo in Github; This repository is dedicated to teaching the F# language in tiny increments. The idea is you come back to the repo every day for a small dose of Functional Programming (FP).   Every day you get some small F# exercises. As each exercise only takes a few minutes, not enough time is not an excuse!

Team Foundation Server 2015–Enable NUnit tests for new Build system

I’m working on replacing the existing build system we use based on XAML Workflow by the new build system introduced in TFS 2015. So far, I really like the experience. Customizing became a lot easier than it was before… However one of the things I noticed that no Test Results were collected.   I opened up the Test Assemblies Step in the build process(click on the step in the Build Results). There I could see that the vstest.console.exe was invoked but that no tests were discovered. The reason is that I’m using NUnit and therefore a test adapter should be installed and loaded on the build server. Enable NUnit Test Adapter for TFS Build To enable the NUnit Test Adapter, you have multiple options: Option 1- Use the NUnit Test Adapter DLL’s Log in to your build server Download the NUnit Test Adapter for Visual Studio from the Visual Studio gallery: Extract the VSIX file(don

TFS 2015–The item may not be cloaked because it does not have a mapped parent.

I’m working on replacing the existing build system we use based on XAML Workflow by the new build system introduced in TFS 2015. So far, I really like the experience. Customizing became a lot easier than it was before… However not everything is perfect. While building a solution I noticed the following error message: “The item $/Framework en Tooling/Drops may not be cloaked because it does not have a mapped parent.” Let’s find out what was going on. Open your favorite browser and navigate to the web access portal for your team project Click on the BUILD tab Expand the Build Definition section, right click on the failing Build definition and choose Edit… from the context menu The build definition is loaded. Now click on the Repository tab. On this tab you see the workspace mapping used for the build definition. In my case it looked like this: Seeing this immediately explained the error message. I was cloaking a folder that was on the same l

Branching strategies–Blog series

There is a lot of discussion going on about branching strategies and how a good branching strategy looks like. My preferred branching strategy has only 2 rules: Rule #1 – Don’t branch Rule #2 – Go read Rule #1 Branching should be an exceptional case as every branch introduces a merge cost (and this cost can be high!). Of course in reality, it’s not always that simple. With the renewed vibe around Continuous Integration and DevOps, a good branching strategy is crucial. One blog series I recommend reading is Version Control Strategies : This series of articles describes a taxonomy for different types of Feature Branching – developers working on branches in isolation from trunk – and how Continuous Integration is impacted by Feature Branching variants. Organisation Antipattern: Release Feature Branching – the what, why, and how of long-lived feature branches Organisation Pattern: Trunk Based Development – the what, why, and how of trunk development

TFS 2015 installation error - TF400069: You must install either SQL Server Analysis Services version 11.0 or the SQL Server Client Tools.

Last year , I had a TF400069 error when installing Team Foundation Server 2013. This year, while installing Team Foundation Server 2015 for a customer, the error reappeared. Did I learned nothing?   In this case, the situation was a little bit different than before. I no longer installed the Reporting Services component on the TFS application tier. As a consequence, the SQL Client Tools Connectivity libraries were missing on the application tier. These libraries are required to let TFS talk successfully to the data warehouse. To solve it, load the SQL Server installation media on your application tier(!) , start the installation wizard and enable the Client Tools Connectivity .

Team Foundation Server 2015–Office Integration Installer

With the release of Team Foundation Server 2015, we had to say goodbye to Team Explorer. This was kind of annoying as it was the most easy way to get the Office integration installed. But Microsoft promised an alternative and with the announcement of TFS 2015 Update 1 RC , it is finally there. A preview of the new TFS Office Integration Installer was released. This new installer addresses a couple of scenarios: People like project managers, BAs, etc that wanted to use our Microsoft Office integration capabilities used to have to install the Team Explorer package.  It was uncomfortably large and included a VS Shell instance that most of them really didn't want.  This new installer just includes the Office integration component (Excel, Project, etc) and is therefore lighter weight. The PowerPoint storyboarding tool is now available without VS Enterprise/Test Professional. It’s included it in the Office Integration Installer, making it very easy to get with the rest of th

The Agile Mind

As a father but also as a manager, I was listening with great aspiration to the Software Engineering radio episode: Linda Rising on the Agile Brain . In this episode Linda explains how our minds can be agile or fixed and how we can evolve to a more Agile mind. This really changed my perspective on how to encourage and stimulate other people. This one is a life changer! Some related articles: How Not to Talk to Your Kids. New York Magazine Video: Linda Rising. The Agile Mindset — and beyond. GOTO Aarhus 2013

TFS Build: Configure Package source to Enable Package Restore on your Build server

On a project we are working on, we don’t store the NuGet packages in source control, but use NuGet Package Restore instead. This works nicely and even on the build server the NuGet packages are downloaded before the project is compiled. Problems started to arise when we switched to an internal package repository. When working with Visual Studio, this wasn’t an issue as we just had to add the internal package repository as a new Package Source. However this is not something we could do on the build server. When building the project on the build server, we got errors like: “Unable to find version 'xxx' of package 'xxx'” So how can we fix this? NuGet configuration is using a hierarchical system similar to how web.config files work. So what we can do is create a nuget.config file at %ProgramData%\NuGet\Config\. In this nuget.config we add a packageSource reference: That’s it!

NUnit–Method has non-void return value

When running our NUnit tests on the build server, some of them failed with the following error message: Method has non-void return value When I looked at the failed tests, they were all using the async/await syntax: I found the following posts mentioning the error message: The proposed solution was to updated NUnit to a more recent version, but when I took a look on the build server we were already using NUnit 2.6. Anyone with an alternative solution?

TFS Local Workspaces error -TF400030: The local data store is currently in use by another operation.

On a large Visual Studio project I started getting the following error message: TF400030: The local data store is currently in use by another operation. This project is using the local workspace feature of TFS, which has a lot of advantages, but has it own set of problems when your solution gets quite large(think 50.000 items or more). I tried multiple solutions to solve the issue: One possible solution is to delete the local workspace and recreate it again. This will clear the local version table, and allows you to start over with a clean slate. We noticed a small performance improvement after doing this. An alternative could be to evaluate your current workspace and see if some server side folders should not be mapped. This can help decrease the size of your workspace. Another option you have is to change back from a local workspace to a server workspace. As mentioned before, this option is useful only when your workspace contains a lot of items. In that case s

WPF/WinForms: Set the Windows Identity as the CurrentPrincipal

In a WPF application we created(yes, WPF is still alive and kicking), security is based on the Windows Identity people used to login on their systems. However we noticed that when we checked the current Identity through System.Threading.Thread.CurrentPrincipal.Identity , we got the following back:  {System.Security.Principal.GenericIdentity}     [System.Security.Principal.GenericIdentity]: {System.Security.Principal.GenericIdentity}     AuthenticationType: ""     IsAuthenticated: false     Name: "" To change this, we used the following line of code: AppDomain.CurrentDomain.SetPrincipalPolicy(System.Security.Principal.PrincipalPolicy.WindowsPrincipal); After doing that, calling System.Threading.Thread.CurrentPrincipal.Identity returned : {System.Security.Principal.WindowsIdentity}     [System.Security.Principal.WindowsIdentity]: {System.Security.Principal.WindowsIdentity}     AuthenticationType: "Ker

NHibernate 4.0 - NHibernate.QueryException : Cannot simultaneously fetch multiple bags

After upgrading to NHibernate 4.0, the following code started to fail: Before I could easily fetch a collection together with its children and grand-children, but now I got the following error message instead: NHibernate.QueryException : Cannot simultaneously fetch multiple bags. StackTrace:    at NHibernate.Loader.BasicLoader.PostInstantiate() in n:\nhibernate-core\src\NHibernate\Loader\BasicLoader.cs:line 38 at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) in n:\nhibernate-core\src\NHibernate\Impl\SessionImpl.cs:line 1880 at NHibernate.Impl.CriteriaImpl.List(IList results) in n:\nhibernate-core\src\NHibernate\Impl\CriteriaImpl.cs:line 265 at NHibernate.Impl.CriteriaImpl.List[T]() in n:\nhibernate-core\src\NHibernate\Impl\CriteriaImpl.cs:line 277 at Test.Data.Tests.MultipleChildCollectionsTests.Fetch_GrandChildren_Using_QueryOver_And_JoinAlias_Statement() in c:\Projects\Tests\MultipleChildCollectionsTests.cs:line

NUnit Test Adapter - BadImageFormatException

Yesterday I mentioned that my NUnit tests were not discovered when I set the Build Target to ‘x64’ and that I had to change it to ‘Any CPU’ to be able to run my tests. However this only solved part of my problem as my tests started to fail with the following error message: In theses tests I’m using Noesis.Javascript, a .NET wrapper around Google’s V8 Javascript engine, that allow you to execute scripts directly from .NET code. Noesis.Javascript.dll needs the Microsoft Visual C++ Libraries and to use them, you have to set your Compiler target to a specific platform(x86 or x64). So back to start… After some research, I found a solution: Inside Visual Studio, click on Test –>Test Settings –>Default Processor Architecture This was set to X86. Changing it to X64 solved my problem.

NUnit Test Adapter–No tests found to run

Today I discovered an annoying bug in the NUnit Test Adapter , a Visual Studio extension that integrates NUnit test execution in the IDE. I created some new tests for a specific library, however when I tried to load and run my tests, nothing happened. Inside the output window I noticed the following message: What was causing the issue? When I looked at the Build settings for my test project, I saw that the Compiler platform was set to x64. After changing it to AnyCPU , my tests were discovered…

Test a website performance– is a great tool to test your website performance. From the website : Run a free website speed test from multiple locations around the globe using real browsers (IE and Chrome) and at real consumer connection speeds. You can run simple tests or perform advanced testing including multi-step transactions, video capture, content blocking and much more. Your results will provide rich diagnostic information including resource loading waterfall charts, Page Speed optimization checks and suggestions for improvements. Let’s have a look at some of the rich information it has to offer: A high level overview with a score(between A and F) for important performance characteristics(Remark: I notice that I have some work to do optimizing and caching my images). During the test, the page is loaded twice. Once to see how the first view performs and the second time to check for caches. A waterfall diagram is shown with all the loaded resources and a screenshot is

Inspiring blog post–“Let a 1,000 flowers bloom. Then rip 999 of them out by the roots.”

Let’s start the week with an inspiring post by Peter Seibel about the Engineering Effectiveness team at Twitter. There is so much hidden knowledge in this post, that I can keep reading it over and over… Click on the link and learn!

Goodbye ClickOnce! Hello Squirrel!

Over the years I developed a ‘love/hate’ relationship with ClickOnce. Although really great when it works, the moment something goes wrong, you’re in for some pain. Recently I discovered Squirrel, an open source product, using the following tagline: “Squirrel: It's like ClickOnce but Works™” Squirrel is both a set of tools and a library, to completely manage both installation and updating your Desktop Windows application, written in either C# or any other language. It even works on other platforms. Squirrel uses NuGet packages to create installation and update packages, so creating an installer is easy. Check out the user documentation and the Getting Started page , which includes a Quick Start guide.

Visual Studio and Team Foundation Server 2015 ALM Virtual Machines

For years Brian Keller has been delivering a fully functional TFS VM together with a great set of hands-on-labs, everything an ALM expert needs to keep his knowledge up-to-date. Last year Brian moved away from his role as evangelist for Microsoft ALM, luckily his colleague Sachin Hridayraj continued the story. Yesterday he released a brand new Visual Studio 2015 version, complete with a revised set of hands-on-labs and demo scripts, at .