Monday, June 9, 2014

Team Foundation Server - Automatically Updating Process Template

Team Foundation Server provides a tremendous amount of customization, if you're willing to dive into it. Using the TFS Power tools, it's much easier to update templates of both local copies and remote data. This presents a larger issue of tracking changes and populating changes out to multiple projects.

Alkampfer provides a great starting point that works against a single project. I've modified it to work against multiple projects below as well as filter the work item template directory to only include xml files. The TFS Power Tools add in some extra designer files.

One other issue I ran into is that, at least in my default instance of TFS 2013.2, the build service account had been left out of the Service Accounts TFS group. Adding the account required this from the command line:
.\TFSSecurity.exe /g+ "Team Foundation Service Accounts" n:[DOMAIN]\[BUILD SERVICE]/server:https://[TFS]


Friday, May 2, 2014

No build provider registered for the extension '.cshtml'

There is no build provider registered for the extension '.cshtml'. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value 'Web' or 'All'.

This is an especially annoying bug that pops up occasionally in development, often after making no changes to the web.config or any cshtml files. Cleaning and recompiling the solution doesn't work (even after undoing any changes that worked 30 seconds ago).

Only valid solution I've found is to stop IIS Express and delete the temp ASP.Net files. Restart, and all is well. There are other situations where this error is valid, but if it pops up randomly, time to dump the temp files.

Friday, April 18, 2014

Randomizing Data

Ideally, development and testing data is reasonably robust to allow for realistic testing. Occasionally though, pulling in a copy of the production database is useful to hunt down specific cases. Personal information should be scrubbed from this though. is a great tool for generating large amounts of random data. It's easy to install a local copy too. Data sets can be saved and re-used. Large amounts of seed data for testing can also be created.

To replace existing columns with random data, its fairly straight forward to create an SQL script to do this.

The general script runs as follows:

  1. Create a temp table to store our random data for the duration of the transaction
  2. Insert random data, generated from This will need to be massaged a bit if going to MsSql.
  3. Update appropriate tables and fields using CROSS APPLY
  4. Woot! Data scrubbed!

Tuesday, April 15, 2014

String Manipulation with Humanize

Humanizer looks like a great string manipulation library for handling common readability tasks. This looks like it would remove a couple of my extension methods while adding a lot of extra functionality.

Tasks like hinting the number of items found and properly handling the singular case, ie 1 Item, 2 Items.

Sunday, March 30, 2014

Preserving Grid State in KendoUI

Continuing from the last post about preserving tab state, next up is automatic, universal grid state preservation. The state could be stored to the session, but then code has to be added server side for each Ajax endpoint. That's not possible of the grid is polling a third party service as well. It's better to handle it all client side with local storage.

The script will wrap around the grid constructor and setup events to capture the state. It also checks if you wish to use local or session storage in the browser. Local storage persists across browser closes while session won't. Both are useful for different situations.

Currently, only a limited state is captured:
  • Page
  • Page size
  • Sorts
  • Filters
  • Grouping
Other options like visible columns are not stored.

The jquery extension for local storage is just a slightly modified version of Marcus Westin's store.js. Modified to attach to jquery and allow selection between local and session storage.