Wednesday, August 24, 2016

Web.config transformations: How to update an appsetting value

Web projects in Visual studio support the concept of web.config transformations, making it easy to update your configuration depending on the build you are using.


Yesterday I had a hard time to remember what the exact syntax was to update a specific appsetting. So here is a small snippet to help me remember:

Tuesday, August 23, 2016

TFS–User \ needs the 'ManageBuildResources' permission to add, update, or delete the build resources on the server.

When trying to install and configure a XAML Build controller I got the following error during the validation step:
User <domain>\<username> needs the 'ManageBuildResources' permission to add, update, or delete the build resources on the server.
Ok, no problem. I know that to configure the XAML Build and link it to a specific collection you need to be part of the Project Collection Administrators or Project Collection Build Administrators group. So I opened up the TFS Administration Console, browsed to the Collection where I want to add a build controller and clicked on Group Membership. The Global Groups window is loaded and here I can add the user(Click on Properties… –> Add).
Unfortunately this didn’t solve the problem. Although I had added the user to the correct groups, the error keeps appearing…
However when I added the user to the same groups through the web portal, it did work. Strange!

  • Open the Web Portal
  • Go the Administration site
  • Select the Collection level
  • Go to the Security tab
  • Select the Project Collection Administrators group
  • Click on Members and add the user


Monday, August 22, 2016

Team Foundation Server Administration Console: Index is out of bounds.

Got an email this morning from a customer asking me if I had seen the following error message before when opening the XAML Build Configuration inside the  TFS Administration Console:

“Index 10985 is out of bounds.”


This is an error I had never seen before. The thing is that the system itself was working as expected.

I asked to take a look at the logs. There we noticed that an enormous amount of event messages were generated. Could this be causing the issue?

And indeed after we cleared the event log, the XAML Build configuration appeared again. On the screen some Events related data is shown, probably this couldn’t handle the large load of messages…


Friday, August 19, 2016

Telerik WPF controls: XAML vs NoXAML

On a WPF project we are using the WPF controls from Telerik. Inside the Telerik folder we noticed that their are actually 2 versions of the binaries available; a ‘normal’ and a NoXaml version.

So what’s the difference and which one should I choose?

The normal assemblies contain some components together with a default set of styles and ControlTemplates. As most assemblies contain multiple components this can start to add up, as styles and templates for every component are provided. This also means that some of these assemblies are big.

To decrease the file size, a NoXaml version of the assemblies was created including only the components themselves but no xaml code(styles, brushes, controltemplates,…). However as the NoXaml version doesn’t contain any visualization information, using these alone will not make much sense. No visual output will be rendered on the screen. A NoXaml dll should therefore always be combined with a theme dll.

So which one should you pick? If you are only using a small set of components and filesize is important to you, use the NoXaml version. Otherwise you can use the ‘normal’ assemblies.

Remark: If you further want to decrease the file size, you can also decide to not use a theme dll but copy the XAML themes from the Themes.Implicit folder to your project. This allows you to remove all styling you don’t use and keep only what’s relevant.

Thursday, August 18, 2016

Akka.NET TestKit–No tests found to run.

I’m currently working on a project where I’m using Akka.NET and the Actor model. I’m amazed by the ease-of-use and how the actor model itself makes complex problems easy to implement. Anyway, I lost some time today investigating a problem that a colleague had. After installing TestKit and writing his first actor based unit test, the Test Runner explorer refused to work and the only output we got was:

No tests found to run.


After a few minutes I realized our mistake, we downloaded the Akka.TestKit.NUnit which is suitable for NUnit 2 and older. However we are using NUnit3, which requires a different NuGet package; Akka.TestKit.NUnit3.  After installing the correct NuGet package, our tests appeared and the problem was gone.

Kind of stupid to stumble over this problem because I had the same issue before (and even mentioned it explicitly in a previous blog post about Akka.NET; Confused smile

Wednesday, August 17, 2016

Angular 1.5 Components: Pass event data to components

I got some trouble finding out how to pass event data from a child component to a parent component.

Here is a quick example to explain the problem:

- Imagine I have a ProductListingComponent. Inside this ProductListingComponent, I have a ProductListComponent that renders a list of ProductListItemComponents. On every ProductListItemComponent I have a “Add to Basket” button. When I click on this button I want to add the selected product to my shopping basket that is managed at the ProductListingComponent level.


How can I easily pass the selected product up to my parent components? Let’s find out.

Let’s first create the 3 components with their html:

Now I want to add a function to handle the click on the “Add to Basket” button and pass the product to the parent component. The correct way to pass data between child and parent component is through events. So let’s first add an ng-click directive to the button and extend our components to output an event:

Last step and that is the most tricky one is to pass the product information through the event up to the parent controller. The magic is in the html of the ProductListComponent where I create a map of local variable names and values and pass it to the event: on-select="$ctrl.onSelect({product:product})". Angular will recognize the Product property by it’s name and pass it on to the product variable in the onProductSelected function of the parent controller: on-select="$ctrl.onProductSelected(product)".

Tuesday, August 16, 2016

.NET 4.6.2–The Long Path edition

While cleaning up my RSS feeds, I noticed a new update of .NET; .NET 4.6.2. Normally I wouldn’t care so much for a minor release but this one caught my attention.

Why? Because the following fix was mentioned; Fix the 269 character file name length limitation. This  has annoyed me for a long time, and I’m happy to see that they finally fixed it. For most of my applications it didn’t matter but I had some file copy tools that got into trouble when folders were nested too deeply.

This new capability is enabled for applications that target the .NET Framework 4.6.2 (or later).

From the announcement:

The following improvements were made to enable long paths:

  • Allow paths that are greater than 260 character (MAX_PATH). Paths that are longer than MAX_PATH are allowed by the BCL. The BCL APIs rely on the underlying Win32 file APIs for limitation checks.
  • Enable extended path syntax and file namespaces (\\?\, \\.\). Windows exposes multiple file namespaces that enable alternate path schemes, such as the extended path syntax, which allows paths to just over 32k characters. The BCL now supports these paths, such as the following: \\?\very long path. The .NET Framework now primarily relies on Windows for path normalization, treating it as the “source of truth”, to avoid inadvertently blocking legitimate paths. The extended path syntax is a good workaround for Windows versions that don’t support long paths using the regular form (for example, `C:\very long path’).
  • Performance Improvements. The adoption of Windows path normalization and the reduction of similar logic in the BCL has resulted in overall performance improvements for logic related to file paths. Other related performance improvements have also been made.

More details on these changes can be found on Jeremy Kuhne’s blog.