Skip to main content

Posts

Showing posts from 2008

Recursive Copy in TFS MSBuild

In working with TFS I just discovered the Well-Known Item Metadata (bad name in my opinion as I don't they they are really all that "Well-known") which can be used in MSBuild. One of these is %(RecursiveDir) . From MSDN: If the Include attribute contains the wildcard **, this metadata specifies the path to the file, beginning at the location of the wildcard. For more information on wildcards, see How to: Use Wildcards to Build All Files in a Directory. This example has no RecursiveDir metadata, but if the following example was used to include this item, the item would contain a RecursiveDir value of MyProject\Source\.   < ItemGroup > < MyItem Include ="C:\**\Program.cs" /> </ ItemGroup >   If the following example was used to include this item, the RecursiveDir value of the item would remain MyProject\Source\.   < ItemGroup > < MyItem Include ="

Custom TFS Task to Change WorkItem State

I recently had to create a custom task to update the state all work items associated with a changeset were in. Here is the code I came up with to accomplish this. First we start of by creating a general class that includes a few properties. The properties will allow us to pass in variables to the task. LocalPath and BuildURI are variables which TFS build provides for you. I also included the using statements you need to have for this task. 1: using Microsoft.Build.Utilities; 2: using Microsoft.TeamFoundation.Client; 3: using Microsoft.TeamFoundation.VersionControl.Client; 4: using Microsoft.TeamFoundation.WorkItemTracking.Client; 5: using Microsoft.TeamFoundation.Build.Client; 6:   7:   8: namespace MyCustomStuff.TFS.Tasks 9: { 10: public class UpdateWorkItemStatus : Task 11: { 12: // A value for each one of these properties must be supplied i

Silverlight Webcasts

Here is a great list of Silverlight webcasts to help get people started. Really great work from Mike Taulty ! Silverlight - Hello World Silverlight - Anatomy of an Application Silverlight - The VS Environment Silverlight - Content Controls Silverlight - Built-In Controls Silverlight - Width, Height, Margins, Padding, Alignment Silverlight - Using a GridSplitter Silverlight - Grid Layout Silverlight - StackPanel Layout Silverlight - Canvas Layout Silverlight - Databinding UI to .NET Classes Silverlight - Simple Styles Silverlight - Custom Types in XAML Silverlight - Binding with Conversion Silverlight - List Based Data Binding Silverlight - Simple User Control Silverlight - Templating a Button Silverlight - Resources from XAP/DLL/Site Of Origin Silverlight - Animations & Storyboards Silverlight - Uploads with WebClient Silverlight - Downloads with WebClient Silverlight - Calling HTTPS Web Servi

Copy Multiple Files via TFS build

bI have recently been doing a lot of work with TFS and want to write about a few things I had to figure out how to do. As part of my build process I had a number of dlls I needed to copy out to my staging environment. To do this I overrode the AfterCompile target. In order to override this Target you have to import the Microsoft.Common.targets file. <Import Project="$(MSBuildBinPath)\Microsoft.Common.targets" /> In MSBuild you can call Copy which will move a file from one location to another location. The key word here is that it will move "a file", it will not move "files." So you can call something like this: <Copy SourceFiles="$(DeployStagePath)\my.dll" DestinationFolder="$(DeployPath)" /> But you cannot use code like this to copy all dll files: <Copy SourceFiles="$(DeployStagePath)\*.dll" DestinationFolder="$(DeployPath)" /> To copy all dlls in a folder you need to crea

MOSS 2007 Templates

I needed to have a quick reference guide to the different templates in MOSS 2007 and what each one is for. So here it is. Template Category Template Name Description Collaboration Team Site A site for teams to quickly organize, author, and share information. It provides a document library, and lists for managing announcements, calendar items, tasks, and discussions.   Collaboration Blank Site A blank site for you to customize based on your requirements. Collaboration Document Workspace A site for colleagues to work together on a document. It provides a document library for storing the primary document and supporting files, a tasks list for assigning to-do items, and a links list for resources related to the document. Collaboration Wiki Site A site for a community to brainst

WPF Localization - LocBaml

In my last post I talked about using resource files (resx) to localize your WPF application. This time it is about using LocBaml to localize your WPF application. The big difference in the two approaches is that LocBaml allows you to localize your application after the fact. That is, most applications you have to plan up front to do localization, but with LocBaml you can still localize your application after development. While lots of people will say this I don't really believe it. The reason this is not true in my opinion is because LocBaml only works if all your strings are sourced in XAML. This means that if you use strings that are located in a constant file or a resx file LocBaml  will not work to localize your application. Unless you are building a smaller application or you just happen to set up your architecture so all strings are sourced in XAML you are out of luck. So really when they say you can localize your application after the fact you really can only do it if you h