Use a PIN code instead of password on your Surface Pro (or other Windows touch device)

Here are step instruction on how to replace the Windows login password prompt with a PIN code, especially on those yummy new Windows tablets (I am looking at you Surface Pro 3):

2014-11-21_21-32-422014-11-21_21-33-38  2014-11-21_21-33-582014-11-21_21-34-33

 

 

MSpec TeamCity Parallel Runner – NuGet package change

Two quick updates:

The mspec parallel test runner for TeamCity nuget package is now located at: https://www.nuget.org/packages/Machine.Specifications.TeamCityParallelRunner/

This change was required in order to start following the MSpec version numbers and package naming convention.

The package version as of this moment is 0.9.0, which matches MSpec 0.9.0.

If you know how to write a .nuspec which can tell NuGet that it should obsolete one package with another packages – do let me know, please.

Announcing an MSpec Parallel Test Runner for TeamCity (mspec-teamcity-prunner)

MSpec is absolutely great – no argument about it. I am using it exclusively in a current project to specify and test top to bottom. However one thing that has been bugging me for a long time is the inability to run tests in parallel on TeamCity. Most Visual Studio tools support it (CodeRush, ReSharper, etc) – why shouldn’t it be possible to do it on the build server? And as test run time kept increasing I finally got fed up and did something about it.

I am pleased to announce mspec-teamcity-prunner.exe. It is a drop-in replacement for the default console runner (mspec.exe) with the major difference that through the –threads N parameter you can specify the number of assemblies to run in parallel.

Drop-in replacement means that all you need to do is swap the path to mspec.exe with the one to mspec-teamcity-prunner.exe in your TeamCity Build Step.

For me this has lead to ~70% reduction in the time it takes to run our MSpec test suite.

Details on the project and installation instructions/NuGet package here:

https://github.com/ivanz/mspec-teamcity-prunner

 

Traktor Pro .tsi file format reverse-engineered – docs on GitHub

I’ve reverse-engineered the .tsi binary file format specification, which Traktor Pro by Native Instruments uses to store its Controller Mappings. I am hoping this should open the gates to new power tooling for MIDI controller mapping power tools (Traktor’s own being rather sub-optimal).

The project, documentation and instructions are here: https://github.com/ivanz/TraktorMappingFileFormat/wiki

Can’t sing enough praises of 010 Editor by SweetScape which enabled me to write scripts and define data structures incrementally on top of a binary blob.

2014-10-20_01-53-45

Guide for migrating an ASP.NET MVC Solution to .NET 4.5 and ASP.NET MVC 4

You can find a very handy step by step guide for migrating to ASP.NET MVC 4 here . It might seem a bit long, but actually with a few multi-file search and replace and some regex you can do it pretty quickly.

I just wanted to add a few more tips:

Migrating to ASP.NET MVC 4

If you are still using bin deployables (“Add Deployable Assembly”) for your current ASP.NET MVC setup – you should remove it and replace it with the AspNetMvc nuget package.

If you are using MvcContrib or MvcFutures – it’s probably best to update to* MvcContrib.Mvc3-ci *and *Mvc3Futures . *Either case you will have to deal with the clash of extension methods (Html.IdFor, Html.NameFor, etc) which were previously in Mvc Futures (Microsoft.Web.Mvc.dll) but now are part of the core ASP.NET MVC assembly. Until updated versions of MvcContrib and MvcFutures come out I have resolved this by removing the  using statement from my View’s Web.config for the MvcFutures extensions methods namespace. This however means that you lose tiny things like Html.SubmitButton, which you can easily replace across the whole solution with html code using a Regex.

Be careful about underwater rocks like this one about the new Date and DateTime editor templates in MVC 4. Also there seem to be model binding changes to do with DateTime – so far that has been the major pain in the ass for me.

Re-targeting for .NET 4.5

The fastest way to convert all projects is by doing a search and replace across all .csproj files and replace v4.0  with v4.5 *(or client profile, etc)

also replace in your Web.config compilation element targetFramework=”4.0″ with 4.5

The real issue are the NuGet packages – some have a .NET 4.5 specific version – a good example is Entity Framework. When the project is targeting version 4.0 of the framework and you install/update EF to version 5 you actually end up with EF 4.4 (which doesn’t have support for enums and so on). The only way to solve this is to remove all packages and install them again, which is a massive pain to do manually and unfortunately the current version of NuGet is not of much help there either, but the daily build is. More details about retargeting the NuGet packages are available in this StackOverflow question.

A few other notes

Things that I have personally tested and work fine: MiniProfiler works fine with an runtime assembly binding redirect for Entity Framework, ELMAH and Ninject work without any changes. Noticed a small regression in unobtrusive validation and checkboxed when pulling a form with AJAX, but I that ended caused by a jQuery Validation problem.

Oh and by the way, don’t forget to update your test assemblies *App.config *with the correct assembly redirects if you are running tests against ASP.NET MVC controllers, which use MvcFutures or MvcContrib, because you will end up seeing weird “Type A doesn’t match type A” errors.

To be honest I haven’t seen noticeable performance improvements with the MVC 4 + .NET 4.5 + EF5 combo so far, but time will tell.