Sunday, December 5, 2010

MS Tech ED 2010 Day 4, Friday November 12, 2010

Today only 2 sessions (out of 3), because we have to leave early.

Architecture in Agile Projects – How to do it right

Speaker: Mitch Lacey (
Timeslot: 09:00-10:00


  • Don’t expect that software will be right the first time. Accept that and write throw away code, just to learn. Create a working solution as quickly as possible. That’s when the light goes to green for the first time. After that refactor the code in order to complete new tasks (user stories), but always keep the bar green.

Light up on Windows 7 with WPF and Silverlight

Speaker: Pete Brown (
Timeslot: 10:30-11:30


  • This presentation was all about possibilities with the new Windows 7 API
    • System.Device.Location API access to GPS devices
    • Demo: Out of browser with Silverlight
    • Use dynamic for accessing IDispatch objects
    • Automation: Automate Excel
    • Location API: For connecting GPS and other kind of location sensors
    • Icon Overlay at the taskbar icon (automatically fading in/out)
    • Taskbar buttons at the button of the preview dialog (buttons can trigger an ICommand or event) TaskbarItemInfo.ThumbButtonInfos.
    • Progress bar overlay for the taskbar icon
    • Jumplist: Not specific to an instance of the application but to all. Defined in App.Xaml or App.Xaml.cs
    • WpfAccelerometer: About $30. Brand Freescale
  • All in all a very nice closing session and worth viewing.

MS Tech ED 2010 Day 3, Thursday November 11, 2010

Giving your Windows Phone XNA Games Plenty of Whizz and Bang

Speaker: Rob Miles (
Timeslot: 09:00-10:00


  • Very entertaining and informative session. Watch the video for lots of information about Windows Phone Development and a good laugh.

The Future of parallel programming in Visual Studio

Speaker: Drew Robbins
Timeslot: 10:30-11:30


  • Current (available in .NET 4.0 for doing parallel programming):
    • Programming Models:
      • PLINQ,
      • Parallel loops
      • F#
    • Tools:
      • Concurrency Profiler
      • Debug
        • Parallel Tasks window
        • Parallel Stacks window
  • Future (available in .NET 5):
    • Tools:
      • MPI/GPU Profiler
      • MPI Debugger
      • GPU Debugger
      • Parallel Watch
    • Programming Models:
    • Language:
      • “async” modifier
      • “await” operator
  • HTTP://
  • DryadLINQ (Parallel LINQ on the cloud):

Microsoft Silverlight Performance on Windows Phone 7

Speaker: Oren Nachman (
Timeslot: 12:00-13:00


  • At least 2 threads in SilverLight
    • UI Thread
    • Compositer Thread (Phone specific)
    • User Threads
  • Debug Tools:
    • Counters
    • Redraw Regions
    • Calculate Fill Rate
  • CacheMode = new BitmapCache();

Managed Extensibility Framework in Action

Speaker: Dino Esposito (
Timeslot: 14:30-15:30


  • MEF:
    • A special IoC framework available right within the .NET FX 4.0
    • Component based
    • Does IoC, but has different goals
    • and IoC overlap, but are different
  • Imports are automatically
  • Overlap: Injecting code into classes

Software Testing with Visual Studio 2010: Making it Real for YOU

Speaker: Brian Keller
Link: n.a.
Timeslot: 16:30-17:30


  • Discussion session about VS 2010 capabilities for software testing.
  • VS 2010 Ultimate supports a record mechanism for automated UI testing.
    • References UI elements by their name (if possible), not their clicked mouse positions.
    • Replay is default as fast as possible, but can be slown down by inserting special commands.

Agile Estimation

Speaker: Stephen Forte (Telerik)
Timeslot: 18:00-19:00


MS Tech ED 2010 Day 2, Wednesday November 10, 2010

Yesterday I found out that Microsoft focusses on “the Cloud”. I want to know more about it. Especially how a private cloud could be created and if it would be of benefit for our customers.

The public cloud is especially usefull in case where a solution must be very scalable, like the website of an event (i.e. Tech ED). This is due to Microsoft’s pricing strategy.

Private Cloud Reference Architectures with Hyper-V and System Center

Speaker: Arno Mihm/Bryon Surace/Scott Rosenbloom 
Timeslot: 09:00-10:00


  • Software as a Service
  • Platform as a Service
  • Infrastructure as a Service (Today)
  • Private cloud hosted by a third party is possible also with a Hyper-V Cloud Service Providers
  • 6 different Service Partners (i.e. HP, Dell, etc.)
  • Private Cloud Management stack hardware should be redundant

WCF and Windows Server AppFabric - Services Made Easy

Speaker: Jon Flanders 
Timeslot: 10:30-11:30

Windows Server AppFabric is a set of integrated technologies that make it easier to build, scale and manage Web and composite applications that run on IIS.

More info on the two Microsoft products named AppFabric:

Building Windows Phone Games with Microsoft XNA and Visual Studio 2010

Speaker: Rob Miles (
Timeslot: 12:00-13:00

One of the most interesting sessions IMHO. Worthily to watch the presentation.

  • Silverlight 3D is 2.5D
  • Appeared with SL 3.0
  • Now with GPU acceleration
  • Source code of all demo’s is available trough Rob’s own site

Windows Azure Boot Camp, Part 2

Speaker: Brian Prince
Link: n.a.
Timeslot: 14:30-15:30

Microsoft RemoteFX – What is it?

Speaker: Max Hermann/Rob Williams
Link: n.a.
Timeslot: 16:00-17:00

RemoteFX is a technology for making rich media applications capable to run realtime from a MS Windows Server 2008 R2 SP1/Microsoft Hyper-V 2008 R2 SP1. Basically it will sent compressed bitmaps of changed rectangles on the screen.

In order to do this, one needs a special ATI/nVidia graphics card that has a RemoteFX logo. This physical GPU will split it’s GPU into virtual GPU slices. Virtual GPU’s will use such slices. These specifications of those slices can be configured, so that a specific user can get more/less FPS and/or bandwidth.

One advantage from this technique is that very thin clients are now possible, needing nothing more than a monitor, keyboard and mouse attached. Vendors already have devices no larger than a couple of inches that can be mounted on the back of a LCD monitor. The size depends on the needed connecters (DVI, USB, etc).

A great deal of effort has been put in support for USB devices. It’s now possible to connect (at least one) USB device (i.e. phone or multifunctional printer). The thin client does not need to have a driver for this device. A generic USB driver at the thin client routes this device to the (virtual) RemoteFX OS.

Unfortunatly this technique will not be available between clients for remote support scenario’s

Architecting Applications for High Scalability – Leveraging the Windows Azure Platform

Speaker: Eugenio Pace
Timeslot: 17:30-18:30


  • Tailspin is a Software as a Service provider creating Surveys as a Service.
  • Command Query Responsibility Seperation (CQRS) pattern
  • Used many times in highly scalable systems
  • Create many tasks/roles and put them in a single workerrole. This is because you pay per workerrole.

MS Tech ED 2010 Day 1, Tuesday November 9, 2010

Getting your Return on Investment with Microsoft .NET Framework 4.0

Speaker: Drew Robbins
Timeslot: 09:00-10:00


  • It’s possible to run .NET 4.0 side-by-side with older .NET frameworks. It’s also possible to install VS 2010 side-by-side with older Visual Studio versions.
  • With an application manifest file it’s possible to force existing .NET applications to use the new .NET Framework 4.0
  • Starting with the .NET Framework version 4, you can use in-process side-by-side hosting to run multiple versions of the common language runtime (CLR) in a single process. By default, managed COM components run with the .NET Framework version they were built with, regardless of the .NET Framework version that is loaded for the process.
  • Install Visual Studio 2010 trough the new Web Platform Installer: 
  • The .NET 4.0 Client profile has been reduced in download size:
    • 28 MB for x86 platform only
    • 41 MB for x86+X64 platforms
  • A new Enterprise Framework (version 4.0):
  • Introduction of Managed Extensibility Framework (MEF)

Building Data Visualization Applications with WPF & Silverlight

Speaker: Tim Huckaby
Timeslot: 10:30-11:30


Seen a few interesting demos showing the power of WPF/SilverLight and the Microsoft Surface device:

Windows Azure Boot Camp, Part 1

Speaker: Brian Prince
Link: n.a.
Timeslot: 12:00-13:00


  • If anyone wants to give a Windows Azure Boot Camp within his/her own company, take a look at: The Windows Azure Boot Camp team is helpful in supplying training material and free hours on “the cloud” for training purposes.
  • The GreyBox application is designed to alert a user if their Windows Azure compute services are currently running, or are even simply deployed. Great for Azure speakers and POCs you don't want left running:

The Total Noob’s Guide Windows Workflow Foundation 4

Speaker: Max Knorr (
Timeslot: 14:30-15:30


  • WF basically is a visual programming language.
  • Activity can be seen as a control
  • Activity consists of “work to be done” and data.
  • Learned something new along this demonstration about code-snippets with CTRL K,X in Visual Studio:
  • Different kind of activities
    • CodeActivity
    • AsyncCodeActivity
    • NativeActivity
    • DynamicActivity
    • CodeActivity<TResult>
    • AsyncCodeActivity<TResult>
    • NativeActivity<TResult>
    • DynamicActivity<TResult>
  • Windows Workflow foundation can be hosted in AppFabric (which in turn is build on IIS 7).

Tips & Tricks: Visual Studio 2010 IDE & Extensions

Speaker: Chris Dias
Timeslot: 16:30-17:30


10 Things Every New Silverlight and WPF Developer Must Know

Speaker: Pete Brown
Timeslot: 18:00-19:00


  • Very little new stuff for me as a experienced WPF developer.

Tuesday, February 16, 2010

Using batchfile to setup environment for running .NET Process

Today I faced a problem that I wanted to use a third party library, which depends on all kind of environment settings. Since this library came with an accompanying batch file for setting up this environment, I would like to reuse this batch file. After much googling I could not find a satisfying solution for my problem and decided to go for my own. The resulting code is here

// Run 3 commands in a "batch":
// setenv.bat: this will correctly setup the environment
// CLS: Ths will clear the screen (effectively sends a formfeed (\f) to the StandardOutput stream)
// SET: This will display the current environment variables (or send it to standard output
var processStartInfo = new ProcessStartInfo("cmd.exe")
Arguments = string.Format("/c {0} && CLS && SET", pathSetEnv),
RedirectStandardOutput = true,
CreateNoWindow = true,
UseShellExecute = false,
var process = Process.Start(processStartInfo);

// Wait until all commands have been processed

// Grab standard output
var standardOutput = process.StandardOutput.ReadToEnd();

// Grab all lines since last formfeed
var lastFormFeedIndex = standardOutput.LastIndexOf('\f');
var environmentSettings = standardOutput.Substring(
lastFormFeedIndex).Split(new [] { Environment.NewLine },

// Adjust the current Environment Variables with the ones grabbed
foreach (var environmentSetting in environmentSettings)

With the following helper for setting the environment:

public static extern int _putenv(string varName);

private static void SetEnvironmentVar(string environmentSetting)
// We can not use Environment.SetEnvironmentVariable(variable, value);
// The problem relates to an unbalanced environment string encoding (ANSI/UNICODE).
// To prevent such errors, pair the getenv() call with a _putenv call to set
// the environment variables in C#. When using SetEnvironmentVariable() (from
// Kernel32.dll) pair it with a GetEnvironmentVariable in C++ and match your
// string encodings.
// So what uou need to do is replace your SetEnvironmentVariable call with ...
// [DllImport( "msvcrt.dll")]
// public static extern int _putenv( string varName);

// Environment.SetEnvironmentVariable(variable, value);
if (_putenv(environmentSetting) == -1)
throw new TcliWrapperException("Unable to set environment variable");

Monday, October 26, 2009

XamlParseException when no AssemblyInfo.cs file available

In my project I have an exe and a dll assembly. The App.xaml in the exe references a ResourceDictionary in the dll assembly. This had worked for a long time, but all of a sudden it stopped working. The following very frustating error showed up during runtime:

System.Windows.Markup.XamlParseException: Could not load file or assembly 'MyAssembly.MyResource, Version=, Culture=neutral, PublicKeyToken=1cf5186c6493e5b0' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) Error in markup file 'MyAssembly.MyResource;component/MyResource.xaml'. ---> System.IO.FileLoadException: Could not load file or assembly 'Pulsim.UnitConversions, Version=, Culture=neutral, PublicKeyToken=1cf5186c6493e5b0' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Strange thing is, that my compiled MyAssembly gets version

So what this error basically says is: “I’m not able to load my self, because the version is incorrect.”

After several attempts to resolve this issue, I finally got to my build procedure which is based upon msbuild. I use CommunityTasks in combination with an automatic generation of AssemblyInfo.cs. This way makes it possible to include the SVN revision number in the assembly and file version. How to do that can be found here:

That article states that the following addition (among others) must be made to the .csproj file.

   1: … cut …
   2: <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   3: <Import Project="$(RootPath)\Common.proj" />

I finally switched line 2 and 3 in order to get the AssemblyInfo.cs file generated before the XAML parser/compiler kicks in. And guess what: it worked!

Summary: Be sure that an AssemblyInfo.cs file exists and is referenced within your project if you want to use XAML ResourceDictionaries!

Monday, July 13, 2009

Why are my WPF MenuItems grayed out

Well not all of them, but only those bound to WPF Commands.

After a 2 hour search, I finally found that a control that had focus, became invisible because it was not necessary anymore. Upon that event, my menuitems became grayed out (IsEnabled became false). Focussing a visible control on the screen resolved my issue.

So it seems that WPF Commands can not be executed when no focussed control is available.