Skip to main content

Posts

Showing posts from 2015

Upgrading to NUnit 3.0 - OneTimeSetUp: SetUpAttribute attribute not allowed in a SetUpFixture

After upgrading to NUnit 3.0, which became recently available, some of my tests started to fail. When I look at the test results, they all failed with the following error message: SetUpAttribute attribute not allowed in a SetUpFixture In NUnit 3.0, there are some breaking changes regarding the usage of the SetUpAttribute and the SetUpFixture.  You can no longer use the SetUpAttribute and TearDownAttribute inside a SetUpFixture. Instead you have to use the OneTimeSetUpAttribute and OneTimeTearDownAttribute. In NUnit 2.0, I had the following code: In NUnit 3.0, this has to change to: More information can be found here: https://github.com/nunit/nunit/wiki/SetUp-and-TearDown-Changes https://github.com/nunit/nunit/wiki/Breaking-Changes

Open Live Writer re-introduces Blogger support

Last week I blogged about the release of Open Live Writer , the open source fork of Windows Live Writer. I also mentioned that Google decided to pull the plug from the old authentication system, making neither Windows Live Writer and Open Live Writer available for usage with Blogger anymore. One week later, and thanks to the power of open source, I’m happy to say that I can write my blog post in Open Live Write again(the online Blogger editor wasn’t a pleasant experience). In the timespan of a week Martin Woodward made 3 new releases each improving the Blogger integration: https://github.com/OpenLiveWriter/OpenLiveWriter/releases So thanks Martin for this early Christmas present!

RedBook - Readings in Database Systems

Almost every application uses data. Without this data the application is useless. So if you are a DBA, SQL specialist or developer, you should care about data and how it is stored. This makes  'Readings in Database Systems' a must read: Readings in Database Systems (commonly known as the "Red Book") has offered readers an opinionated take on both classic and cutting-edge research in the field of data management since 1988.

TFS 2015: The 'System.Collections 4.0.10' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60318.667'.

After upgrading an existing solution to the new build system in TFS 2015, the build failed with the following errors: The 'System.Reflection.Extensions 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60318.667'. The 'System.Reflection.Primitives 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60318.667'. The 'System.Resources.ResourceManager 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60318.667'. The 'System.Collections 4.0.10' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60318.667'. The 'System.Diagnostics.Debug 4.0.10' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60318.667...

Azure DocumentDB playground

If you want to learn about Azure DocumentDB , Microsoft's NOSQL solution in the Cloud, go take a look at the DocumentDB Query Playground . It gives you an interactive environment to try the rich querying functionality that Azure DocumentDB offers over schema-free JSON data.

SQL Server Performance issues after upgrading from Team Foundation Server 2010 to 2015

After upgrading a Team Foundation Server 2010 environment from a customer to Team Foundation Server 2015, we noticed an enormous spike in CPU and memory usage on the database server. When we drilled further into the issue, we saw the same SQL Server statement being executed over and over again: On the MSDN forums, we found some more information . This is a bug in the TFS 2015 upgrade process that only seems to exist when you upgrade from TFS 2010. A SQL script is available that solves the problem, but the issue is also fixed in TFS 2015 Update 1. So I would recommend that if you have this issue, upgrade to Update 1.

TechNet Virtual Labs

If you want to test a Microsoft product in a risk free environment, try TechNet Virtual Labs . It offers a wide range of virtual environments for testing Microsoft's newest products and technologies.     I forgot that this existed, until a colleague sent an email about it(Thanks Joeri). So if you want to play with for example the Team Foundation Server 2015 bits but don't want to put it on Azure or download and run a VM locally, just search for 'Team Foundation' and a large set of VMs and labs are available. Great stuff!

Cloud Scalability Patterns

Great conversation with Matt Johnson from the Patterns and Practices group, about things we should consider when moving our applications to the cloud. If you want to build your application for cloud scale, this video offers some great insights. Don't forget to take a look at the links he referred to: Azure architecture guidance Performance optimization guidance Scalability best practices Cloud design patterns Async tips

Google did it again - Not found error in Windows Live Writer and Open Live Writer

In the summer of 2015, Google turned off there old authentication system and made the switch to OAuth 2.0. Although better security can only be encouraged in this case it had the unfortunate side effect to break Windows Live Writer, the blog writer I used for years. Luckily, thanks to the effort of Scott Hanselman, Google was kind enough to re-enable the old security mechanism for a little bit longer. In the meanwhile Scott started the effort to make Windows Live Writer Open Source. Last week this story came to an end with the announcement of Open Live Writer , an open source fork of Windows Live Writer. Although some features are still missing, this is great news as it will give Windows Open Live Writer a new future... Inside the announcement, the support for OAuth 2.0 was mentioned as to be added 'VERY SOON': ADDING VERY SOON: Google runs the excellent Blogger blog service. We've worked with the Blogger Team within Google on this project, and they've been k...

Architecture Blueprints for Microsoft Azure

If you are an architect that want to use the power of Microsoft Azure, Microsoft created a set of architecture blueprints for different scenario’s that help you build new solutions fast. For every diagram, a 2D and 3D version(in Visio) and a video explaining the blueprint is available. Certainly useful!​

Visual Studio 2015 Update 1–Parallel Test Execution

If you are still looking for an excuse to start installing Visual Studio 2015 Update 1 , here I got you one: a new feature that existed before but is now finally back in the box is Parallel Test Execution . What is it? From the release notes: The Visual Studio Test Platform introduces support parallel execution of test cases. Parallel test execution leverages the available cores on the machine, and is realized by launching the test execution engine on each available core as a distinct process, and handing it a container (assembly, DLL, or relevant artifact containing the tests to execute), worth of tests to execute. The unit of scheduling is the test container. Within each container, the tests will be executed as per the semantics of the test framework. If there are many such containers, then as processes finish executing the tests within a container, they are handed the next available container. Parallel execution is supported through all launch points - CI, command l...

Goats and Leadership

What do goats and leadership have in common? The answer is … EVERYTHING as explained in the following YouTube video: I found this video on the Nordstrom technology people lab website . Certainly worth to have a look…

Generate your test data

Over the years I used multiple tools to generate test data. Most the time I ended up creating some useful test data by hand or automatically generating random “gibberish”. Last week I discovered GenFu with has the following promising tagline “Awesome Test Data”. GenFu is a library you can use to generate realistic test data. It is composed of several property fillers that can populate commonly named properties through reflection using an internal database of values or randomly created data. You can override any of the fillers, give GenFu hints on how to fill them. For the following Person class… …combined with one line of code… …it generates the following test data… Looks like magic to me! I’m going to try it out for my next set of unit tests…

Windows 10 Development Workshop

Interested in learning Windows 10 development? But you don’t know where to start? Check out the training material for the Hands on Workshop for Windows 10 Developer Training (pfew, what a title!) From the GitHub repo : The purpose of the Workshop is to provide a more interactive developer training experience that minimizes lecture in favor of more instructor led lab experiences. Each module contains a minimal PPT deck and one or more 'hands on labs' for direct delivery in a classroom setting. The lab manuals and solution files for this module have been moved. All hands on labs are now in their own repo at https://github.com/Windows-Readiness/WinDevHOLs so that they can be easily downloaded independently of the slide decks. The day long agenda consists of the following modules, each 60 minutes split between PPT and Lab Intro to the Universal Windows Platform Adaptive UI Live Tiles & Notifications Edge & Web Apps Cloud ...

TypeScript 1.6–Interface errors

This week, a colleague asked me to have a look at his code. He was working on a web project with some TypeScript code but the moment he opened the project hundreds of errors appeared. We discovered that he recently upgraded to TypeScript 1.6 and in this version the object checking rules became more strict: Before TypeScript 1.6 you could do something like this: Note that although the interface only defines 3 properties, the compiler doesn’t complain when I add an extra property to my object literal. In TypeScript 1.6 this is no longer the case, and an error is thrown when you add a property that is not part of the interface: You can suppress this error by passing the --suppressExcessPropertyErrors compiler option. Although I understand the reasoning behind this change, I’m not a fan of this behavior, as it breaks the dynamic nature of JavaScript. More information in the following GitHub issue: https://github.com/Microsoft/TypeScript/issues/3755

Visual Studio Team Services–Code Search extension

With the introduction of the Visual Studio Marketplace, a growing list of great extensions for the Visual Studio ecosystem is coming to us.   The first extension I installed was Code Search , it promises to “provide a fast, flexible and accurate search across your code” inside Visual Studio Team Services. Sounds great! After installing it, when you browse to your Visual Studio Online project(now renamed to Visual Studio Team Services), go to the Code tab and you should see a search box on the top right corner: The search offers a large set of functionality like: Filters: filter by project, by location within a project, by scope, by code type Code collaboration: share search results with other team members Version control integration: lookup history Behind the scenes it is using the power of Roslyn to give you advanced search capabilities. Remark: The code search feature is free at the moment, but this can change after Preview.

TypeScript 1.5 Error–The ‘arguments’ object cannot be referenced in an arrow function

After upgrading a TypeScript project to TypeScript 1.5, the build started to fail with the following error message: “Build: The ‘arguments’ object cannot be referenced in an arrow function in ES3 and ES5. Consider using a standard function expression.” This is the code snippet where the error occured: Starting from TypeScript 1.5 it is no longer allowed to reference the arguments object inside an arrow function. According to the specs, no argument variable is created for an arrow function. To fix this, we can follow the suggestion as mentioned in the error and switch to a normal function expression: More information in the following GitHub issue: https://github.com/Microsoft/TypeScript/issues/1609

Visual Studio Team Foundation Server and Team Services Feature Index

With the incredible pace that Microsoft is releasing new features, and the 3 week release cycle of VS Team Services(aka Visual Studio Online), it’s a challenge to know what features are available in the TFS ecosystem. To help us, Microsoft created a feature index with all the features available to help you plan and track your projects and code, build, test, and release your software applications. Great help! So bookmark this link: https://msdn.microsoft.com/library/vs/alm/overview/alm-devops-feature-index

Failure is not an option, it’s a necessity

Once your architecture has grown to a certain scale, things will start to fail. If you don’t design for failure inside your system, one small error can bring your whole system down. Organizations like Netflix and Uber, but also Cloud Vendors like Amazon and Microsoft have shown us a new style of engineering; Chaos Engineering , that embraces failure. With things like the Netflix Chaos Monkey and more recently the Netflix Simian Army different type of failures are induced to evaluate how the architecture handles these kind of issues. This has completely changed the way I think and design my systems. Luckily new patterns appear and some old patterns get a revival(like Circuit Breaker ) that help us implement these principles. More information: Chaos engineering at Microsoft Azure Search: https://azure.microsoft.com/en-us/blog/inside-azure-search-chaos-engineering/ The Netflix Simian Army: http://techblog.netflix.com/2011/07/netflix-simian-army.html Principles of Chaos...

What Every JavaScript Developer Should Know About ECMAScript 2015

K.Scott Allen wrote a book about the new features in JavaScript. To celebrate the release, it is available for free on Amazon for the rest of this week. Chapters include: Working with variables and parameters Classes Functional features Asynchronous JavaScript Modules APIs

The Web Application Project is configured to use IIS. Could not find the server 'https://localhost/SampleApp' on the local machine. Make sure the local IIS server has been configured to support secure communications.

After configuring a new Windows 10 machine, I loaded my first solution to start fixing some bugs. However the web project in my solution failed to load with the following error message: C:\projects\SampleApp/WebUI.csproj : error  : The Web Application Project SampleApp.WebUI is configured to use IIS.  Could not find the server ' https://localhost/SampleApp' on the local machine. Make sure the local IIS server has been configured to support secure communications. Whoops! Seems that I forgot to configure something in IIS. I didn’t enable the SSL binding on my local IIS instance. Let’s fix this! Open up the Internet Information Services(IIS) Manager Click on the Default Website Click on Bindings… in the Action pane on the right Click on the Add… button to open up the Add Site Binding dialog Specify https in the Type dropdown and choose an appropriate SSL certificate from the list Click OK to close the dialog. The ...

Caliburn.Micro & Windows 10 UWP apps - AmbiguousMatchException

I continued my journey on using Caliburn.Micro in Windows 10 UWP apps. The next thing I tried was to add a device specific view. In UWP apps this can easily be done by adding a second XAML file with the same name and a device family added to it. For example: a device specific version of ShellView.xaml can be ShellView.DeviceFamily-Mobile.xaml . Remark: This is not the only way to specify a device specific version. More information here: http://igrali.com/2015/08/02/three-ways-to-set-specific-devicefamily-xaml-views-in-uwp/   However after doing that, my Caliburn application started to fail with the following exception: AmbiguousMatchException: Ambiguous match found It seems that I’m not the first one with this problem as an issue(and a fix) had already been created on Github: https://github.com/Caliburn-Micro/Caliburn.Micro/pull/227 Unfortunately the fix is , at the moment of writing, not yet released so you have to download the source code and compile the code yo...

Using Powershell to extract users from Sharepoint

Before decommissioning a Sharepoint server, I needed a list of all users on the different team sites. Time for some Powershell magic! On the Technet site I found a script that promised to do exactly what I needed: This script enumerates SharePoint 2010 or 2013 permissions across the entire farm down to the site (SPWeb) level. It also recursively expands the membership of any AD group and lists the assignment role binding on the permission. The output is an XML format . So I copied the script over, logged in on the Sharepoint server and opened up a Powershell command prompt. However when I tried to execute the script it failed with the following error message: Exception has been thrown by the target of an invocation + CategoryInfo : NotSpecified: (:) [], TargetInvocationExcept + FullyQualifiedErrorId : System.Reflection.TargetInvocationException So I opened up the script to find the root cause of the error and saw that it failed on the call to AllWebs : On...

Caliburn.Micro & Windows 10 UWP apps

As a big fan of Caliburn.Micro , I’m happy to see that the team is working on extending their platform support to Windows 10, Xamarin, Xamarin.Forms and so on… An official release is not available yet, but I couldn’t wait to try the UWP support. So I created a Blank Universal Windows app:   I added the Caliburn.Micro package through NuGet(don’t forget to check the Include prerelease checkbox): And then replaced the default App.xaml file with the following code: The only thing missing is a View and a corresponding ViewModel. As Caliburn prefers convention over configuration, we can create a Views folder and put a ShellView.xaml there, the corresponding viewmodel is placed in the ViewModels folder: That’s all we need to get started!

Visual Studio 2013–Git integration–Branches are not visible

Last week I was giving training at a customer. To speed up the exercises, I created each exercise on a different branch in Git and used every commit as a step in the exercise. This made it very easy to walk through the exercise step by step and see how the solution is created. The problem was that inside Visual Studio 2013, people only saw the master branch, but couldn’t see any of the other branches I created( note: in other tools, the branches showed up fine): So what’s the reason?   I discovered that the branch dropdown in Visual Studio 2013 only shows local branches, remote branches are not shown. To see the remote branch, you first have to create a new local branch to start tracking a remote branch. Click on New Branch and select the remote branch from the list. Once you’ve done that, the remote branch will appear in the branch list and you should be able to pull it. Once you've done that, this will appear as a "published branch" allowing you to push and ...

Akka.NET–Cheat sheet

As a newbie in Akka.NET , all help is welcome. So I’m glad that Jason Roberts took the time to create a 3 page cheat sheet PDF as a quick reference guide. Thanks Jason!

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 my.spa.com#product/1/edit, the url is reset to my.spa.com.”   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 issu...

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, http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6073220-diagnostics-logs-should-show-the-vstest-console-co . 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: https://visualstudiogallery.msdn.microsoft.com/6ab922d0-21c0-4f06-ab5f-4ecd1fe7175d Extract the VSIX file...