Daniel Cazzulino's Blog : How to compile and run ALL WPF samples in the Windows SDK with a single command

Subscriptions

News

Source code published in this blog is public domain unless otherwise specified.

 

kzu in LinkedIn

  Microsoft MVP Profile

 Contact

Post Categories

How to compile and run ALL WPF samples in the Windows SDK with a single command

Just issue the following PowerShell one-liner, and you'll compile and run each sample in the SDK (enter all in one line; broken here for readability):

PS C:\WinFx Samples\WPFSamples\AppModel\> 
gci -i *.csproj -r |
foreach
{
pushd ([System.IO.Path]::GetDirectoryName($_.FullName));
msbuild $_.fullname;
(gci -i *.exe -r |
%{ &$_.fullname; read-host; });
popd;
$_;
}

 

"WinFx Samples" is the folder where you installed the samples. It also works from a subdirectory, as you can see, so that you only run the subset of samples you're interested in. Executables may launch twice (from obj and bin outputs) and in some cases a dependent project might not get built before the main one, but hey, it's just a quick trick ;). The process will pause after executing each sample.

Very useful if you're just playing with the technologies and want to get a quick overview through samples of what's possible.

posted on Thursday, November 15, 2007 8:13 PM by kzu

# How to compile and run ALL WPF samples in the Windows SDK with a single command @ Thursday, November 15, 2007 8:39 PM

Just issue the following PowerShell one-liner, and you'll compile and run each sample in the SDK (enter

Anonymous

# Getting Started with WPF @ Wednesday, April 02, 2008 6:12 AM

I don’t know about you, but it seems more difficult to get started with Windows Presentation Foundation (WPF) than it should be. I’ve been dabbling with it for a while, but I recently wanted to build a client-side application to track my...

Anonymous