Friday, July 30, 2010

Changing the TFS temp location

To optimize performance TFS uses a temp folder to get the files that you view. By default the location of that folder is %TMP%\TFSTemp. the TMP environment variable.

Unfortunately there is no option in Visual Studio or Team Explorer to change this location. The only way I found to change it, is by changing the %TMP% environment variable itself:

   1:  set TMP=D:\Temp 
   2:  set TEMP=%TMP% 
   3:  md %TMP%


Remark: Notice that it is possible that the same environment variable is used for other applications too. So be careful when changing this value.

The correspondence between examples and use cases

Most of time we use use cases to extract the domain model from the business people mind’s. As stated by the term itself, use cases should be created by the business user itself. But for a lot of persons(both analysts and business people), wrapping your head around the concept of a use case is very hard. Most of the time the only business persons you can ask for a use case have a technical background.

So I think it’s better to take another approach and don’t ask for a use case, ask for an example. If a business person cannot give you an example, you’re talking to the wrong person.

That implies that they are two different approaches to the same goal, both use cases and examples have their place in helping to understand and create the domain model.

Create random text in Word 2007

An almost unknown feature of Word 2007  is that you can insert lorem ipsum text into the document to create some random text.  Just type in =lorem() into your document, and hit the enter key…

WordLoremIpsum

If you need more text, you can also use the following syntax:

   =lorem(paragraphs,sentences)

For instance, for 6 paragraphs of 20 sentences each, you would use:

   =lorem(6,20)

Enable Intellisense for your custom config sections

Start by creating an XSD file that defines the format of the xml of your config section. You can easily do this in Visual Studio by opening an XML file and choosing XML –> Create Schema from the Toolbar menu.

Imagine we have the following custom configuration

   1:  <CustomSettings name="Something">
   2:    <ApplicationName>SomethingElse</ApplicationName>
   3:  </CustomSettings >


This will result in the following schema:

 

   1:  <?xml version="1.0" encoding="utf-8"?>
   2:  <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
   3:    <xs:element name="CustomSettings">
   4:      <xs:complexType>
   5:        <xs:sequence>
   6:          <xs:element name="ApplicationName" type="xs:string" />
   7:        </xs:sequence>
   8:        <xs:attribute name="name" type="xs:string" use="required" />
   9:      </xs:complexType>
  10:    </xs:element>
  11:  </xs:schema>
 
Now we cannot use this schema directly. What’s important is the schema definition. This should be the same as the default schema Visual Studio uses. This schema can be found in the DotNetConfig.xsd file, which is the same file you should add your XSD to. 
 
   1:  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vs="http://schemas.microsoft.com/Visual-Studio-Intellisense" elementFormDefault="qualified" attributeFormDefault="unqualified" vs:helpNamespace="http://schemas.microsoft.com/.NetConfiguration/v2.0">
   2:    <xs:element name="CustomSettings">
   3:      <xs:complexType>
   4:        <xs:sequence>
   5:          <xs:element name="ApplicationName" type="xs:string" />
   6:        </xs:sequence>
   7:        <xs:attribute name="name" type="xs:string" use="required" />
   8:      </xs:complexType>
   9:    </xs:element>
  10:  </xs:schema>
 

As a last step you can either add the XSD in the DotNetConfig.xsd file, or put it in a seperate file and include that file in the DotNetConfig.xsd file by adding the following line right after the schema declaration in DotNetConfig.xsd.

   1:  <xs:include schemaLocation="CustomSettings.xsd"/>

Clearing a table: the fast way

Just something that can be handy: if you have to clear a table , I always used the following statement before

   1:  DELETE FROM TABLE

Now if you have a table with a large amount of records, this can take a long time. A lot faster way is to use the following SQL statement instead:

   1:  TRUNCATE TABLE

Remark: This is only for SQL Server. I have no idea if this is also true for other database systems.

jQuery Fundamentals

jQuery is a great library and it helped me a lot in starting to like web development. Abstracting away all the typical Javascript problems and giving a nice syntax instead, it makes web development fun again.

Of course learning jQuery still requires some investment from your side, you still need to understand HTML, Javascript and CSS. To help you learn jQuery Rebecca Murphey wrote a free book about the jQuery Fundamentals.

A must read for all web developers and a resource to keep close to you.

Powershell: Include other scripts in your Powershell script

I don’t used Powershell a lot before. But lately I’m starting to discover more and more of it’s richness and how it can make my life a lot simpler.

One of the things that took me some time to figure was how to include other scripts inside your own Powershell script. Now doing is this is very easy(once you know it).

One way to use functions from another script is to use the dot sourcing operator to run the script so that the functions from the script are part of the calling scope. To dot source the script, you use the dot source operator (a period) followed by the path to the script containing the functions you wish to include in your current scope. After you do this, you can call the functions from the other script directly.

An example:

PS C:\> . C:\scripts\ConversionFunctions.ps1
PS C:\> convertToMiles 6
6 kilometers equals 3.7266 miles

Dynamic mapping for NHibernate

In most ORM solutions, you have to create some mapping between your tables and columns in your database and the objects and properties in your domain.

Entity Framework allows you to this through a designer, NHibernate has XML support and some Fluent Mapping options. You can even start introducing conventions to minimize the amount of mapping needed.

But of course, lazy as we are, in some occasions this is still too much work. So if you have some simple objects and some simple queries, another option is available for you; NHibernate transformers.

NHibernate transformers  are used to transform the results of the query into something useful. 

To give you an example, imagine I have a simple product class:

   1:  public class Product
   2:  {
   3:      public string ID{ get; set; }
   4:      public string ProductName{ get; set; }
   5:  }

I’ll can create a simple SQL query and let NHibernate do the mapping for me by calling the AliasToBean transformer:


   1:  var sql = "SELECT ID, PRODUCTNAME FROM PRODUCT"
   2:  var session=SessionFactory.GetCurrentSession();
   3:  var query = session.CreateSQLQuery(sql);
   4:   
   5:  var results = query 
   6:      .SetResultTransformer(Transformers.AliasToBean(typeof(Product)))
   7:      .List<Product>();

The AliasToBean method is a factory method on the static Transformers class.   I don’t have to specify any additional mapping file.


So this is very useful feature when you just want to map any table into a DTO, as long as the DTO matches up well to the underlying query results.

Building a business app with Silverlight, RIA Services and NHibernate

You want to build Rich Internet Applications(RIA) with Silverlight but Linq 2 SQL or Entity Framework doesn’t suit your needs? Then the flexibility of NHibernate could be the answer to help you build maintainable and testable applications.  But how do you get started?

Brad Abrams extended his business app example with NHibernate support.

Go check it out!

Wednesday, July 28, 2010

ASP.NET MVC 3 is getting closer…

Time goes fast and for the ASP.NET MVC team it even goes faster. I just figured out most of the features inside ASP.NET MVC 2 and version 3 is already showing up.

So what's new in ASP.NET MVC 3?

  • Razor Syntax View Engine - Cleaner view syntax
  • Dynamic View and ViewModel properties - passing data between controllers and views using dynamic rather than a dictionary
  • "Add View" Dialog Box Supports Multiple View Engines - You two can be in this box.
  • Service Location and Dependency Injection Support - Get your DI hooked into controller factories, dependency injection, action filters and View Pages.
  • Global Filters - put filters on the all control methods
  • New JsonValueProviderFactory Class - Model bind directly to JSON-encoded data
  • Support for .NET Framework 4 Validation Attributes and IValidatableObject - Easier validation including validating one property based on another.
  • New IClientValidatable Interface - Discovering at runtime if the client supports validation.
  • Support for .NET Framework 4 Metadata Attributes - Support .NET 4 specific attributes like DisplayAttribute
  • New IMetadataAware Interface - Write your own attributes to contribute to the ModelMetadata creation process.
  • New Action Result Types - HttpNotFoundResult, HttpStatusCodeResult.
  • Permanent Redirect - More easily return 301s for Actions, Routes or any URL.

Read more about it:

Monday, July 26, 2010

Microsoft released the Microsoft Visual Studio Scrum 1.0 Process Tempplate

Last week Microsoft announced Microsoft Visual Studio Scrum 1.0, a process template built from the ground up specifically for Scrum teams.

You can download and install Microsoft Visual Studio Scrum 1.0 from the Visual Studio Gallery or you can use the Extension Manager of Visual Studio 2010 (listed under Online GalleryToolsProcess Templates):

Looking for more information? Check out a detailed overview of Microsoft Visual Studio Scrum 1.0 on MSDN.

NHibernate 3.0.0 Alpha 1

Just being back from vacation I noticed that an Alpha version of NHibernate 3.0.0 is released. Don’t wait and start downloading this  great piece of software.

An overview of the new features:

  • Guid support in MySql dialect
  • Query duration is logged
  • Strongly typed configuration
  • WCF Support through the WcfSessionContext   
  • Better exception details
  • Lazy load columns
  • DetachedCriteria support for IStatelessSession
  • New QueryOver syntax
  • And many more…

And of course a lot bugs are fixed too.

Saturday, July 17, 2010

The Big Boy MVC Series

Interested in learning every step–and I mean every–step it takes to create your own website?  Have a look at the Big Boy MVC Series. Written in an informal style, you learn everything about building a successful website with ASP.NET MVC.

WPF ResourceDictionaries

One thing that I noticed when using WPF ResourceDictionaries (and something that I couldn’t find anywhere in any kind of documentation) is that the order in which you add items to your ResourceDictionary is important.

So if you have a DataTemplate that refers to another DataTemplate, you’ll have to put the DataTemplate you refer to first(!).

This XAML gives an error at runtime(Notice how the LinkTemplate refers to the LinkActionTemplate):

   1:  <DataTemplate x:Key="LinkTemplate">
   2:          <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinWidth="106" MinHeight="35" 
   3:              Cursor="Hand" Background="Transparent">
   4:              <TextBlock Text="{Binding Title}" TextWrapping="Wrap"/>
   5:              <ItemsControl ItemsSource="{Binding ChildNodes}"
   6:                  ItemTemplate="{StaticResource LinkActionTemplate}"/>
   7:          </StackPanel>
   8:  </DataTemplate>
   9:      
  10:     
  11:   <DataTemplate x:Key="LinkActionTemplate">
  12:          <StackPanel Orientation="Horizontal" Margin="20,2,0,2" MinHeight="22" Cursor="Hand">
  13:              <Image Source="{Binding IconPath}"  />
  14:              <TextBlock Text="{Binding Title}" >
  15:              </TextBlock>
  16:          </StackPanel>
  17:   </DataTemplate>
  18:      
  19:      


This XAML works fine:


   1:      <DataTemplate x:Key="LinkActionTemplate">
   2:          <StackPanel Orientation="Horizontal" Margin="20,2,0,2" MinHeight="22" Cursor="Hand">
   3:              <Image Source="{Binding IconPath}"  />
   4:              <TextBlock Text="{Binding Title}" >
   5:              </TextBlock>
   6:          </StackPanel>
   7:      </DataTemplate>
   8:   
   9:   
  10:      <DataTemplate x:Key="LinkTemplate">
  11:          <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinWidth="106" MinHeight="35" 
  12:              Cursor="Hand" Background="Transparent">
  13:              <TextBlock Text="{Binding Title}" TextWrapping="Wrap"/>
  14:              <ItemsControl ItemsSource="{Binding ChildNodes}"
  15:                  ItemTemplate="{StaticResource LinkActionTemplate}"/>
  16:          </StackPanel>
  17:      </DataTemplate>
  18:      

Clean up your server after a TFS 2008 to TFS 2010 migration

After upgrading your old TFS 2008 environment to a TFS 2010 environment,the old databases are merged into the new TFS_Configuration and TFS_DefaultCollection databases. So you are left with some unused databases that eat up your diskspace. So after you have confirmed that your new environment is doing it’s job, you can safely drop the following old databases:

  • TFSActivityLogging
  • TFSBuild
  • TFSIntegration
  • TFSWarehouse
  • TFSWorkItemTracking
  • TFSWorkItemTrackingAttachments
  • TFSVersionControl

Bad request on Report Server

After upgrading to a new domain, all our request to the Report Server start failing. The only thing we got back was the very useful ‘Bad Request’ error message in our browser.

It took us some time to find out that the problem was related to the Kerberos authentication that was introduced in the new domain. This helped us tracking the issue and brought us to the following page on the MSDN website; http://msdn.microsoft.com/en-us/library/cc281253.aspx#proxyfirewallRSWindowsNegotiate.

An extract:

On a report server that is configured for Negotiate or Kerberos authentication, a client connection to the report server will fail if there is a Kerberos authentication error. Kerberos authentication errors are known to occur when:

  • The Report Server service runs as a Windows domain user account and you did not register a Service Principal Name (SPN) for the account.

  • The report server is configured with the RSWindowsNegotiate setting.

  • The browser chooses Kerberos over NTLM in the authentication header in the request it sends to the report server.

You can detect the error if you enabled Kerberos logging. Another symptom of the error is that you are prompted for credentials multiple times and then see an empty browser window.

You can confirm that you are encountering a Kerberos authentication error by removing < RSWindowsNegotiate /> from your configuration file and reattempting the connection.

After you confirm the problem, you can address it in the following ways:

  • Register an SPN for the Report Server service under the domain user account. For more information, see How to: Register a Service Principal Name (SPN) for a Report Server.

  • Change the service account to run under a built-in account such as Network Service. Built-in accounts map HTTP SPN to the Host SPN, which is defined when you join a computer to your network. For more information, see How to: Configure a Service Account for Reporting Services.

  • Use NTLM. NTLM will generally work in cases where Kerberos authentication fails. To use NTLM, remove RSWindowsNegotiate from the RSReportServer.config file and verify that only RSWindowsNTLM is specified. If you choose this approach, you can continue to use a domain user account for the Report Server service even if you do not define an SPN for it.

Because we wanted to keep using NTLM, we removed the RSWindowsNegotiate line from the RSReportServer.config. Afterwards everything worked just fine.

Changing identities in TFS 2010

Changing identities in TFS 2010 is a lot harder than you should think at first. There are some things you need to keep in mind while updating identity information inside your TFS environment.

As identity information is stored in a lot of places in TFS, some tools are available to help you. In TFS 2008, identity change was accomplished by running the TFSAdminUtil Sid command. In TFS 2010 this functionality moved into the TFSConfig Identities command.

Some considerations:

  1. Target account restriction - the target account of the mapping should not already exist in TFS. This is a key restriction of TFSConfig Identities , as well as the older TFSAdminUtil Sid. If the target account is somehow introduced, either by being granted permissions or by group membership sync, it cannot be undone. Simply "removing" the user from group(s) will not work. Removing identities in TFS simply marks the record as logically deleted, and does not physically delete because the identity may own TFS artifacts such as changesets or work items.
  2. Batch versus individual mode - if account names are the same in both domains, the command can be run in batch mode. Otherwise identities can changed individually, specifying a different target account name.
  3. Identity source - if the identity was directly added to a TFS group, running the Identity Change command is sufficient. For accounts which were picked up by TFS by syncing AD groups, the source of the data should also reflect the change.
  4. Sync update - after running the identity change command, the next hourly sync will update all properties.

Reactive Extensions for .NET Hands-on Labs

The Reactive Extensions(Rx) for .NET are great, but is not very easy to get your head around it. To help you understand and use Rx, the Reactive Extensions team has created hands on labs for both JavaScript and .NET to get you started incrementally with the Reactive Extensions.  Both labs largely follow each other in terms of format and what areas are covered. 

The .NET lab has the following sections:

  • Exercise 1: Getting started with Rx interfaces and assemblies
  • Exercise 2: Creating Observable Sequences
  • Exercise 3: Importing .NET Events into Rx
  • Exercise 4: A First Look at the Standard Query Operators
  • Exercise 5: More Operators to Tame the User Input
  • Exercise 6: Rx’s concurrency model and synchronization support
  • Exercise 7: Bridging the asynchronous method pattern with Rx
  • Exercise 8: SelectMany: the Zen of composition
  • Exercise 9: Testability and mocking made easy

Monday, July 12, 2010

Microsoft.WebApplication.targets error on TFS 2010 Build Server

After upgrading a client’s environment from TFS 2008 to TFS 2010, the build server started to produce failing builds. Looking through the build log I noticed following error:

“The imported project “C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\ WebApplications\Microsoft.WebApplication.targets” was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.”

Solving this issue is easy. Just copy the v10.0\WebApplications\Microsoft.WebApplication.targets files from your local machine to the directory reported in the error. On your local system you’ll probably find this target file at C:\Program Files\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets

All builds were green again…

Having problems debugging a Silverlight application?

Last week, a colleague was desperately trying to debug a Silverlight application. But nothing seemed to work.

  • Just adding a breakpoint in the code… Didn’t work.
  • Attaching the Silverlight runtime to Visual Studio… Didn’t work.
  • Loading symbols(PDB file) explicitly in the debug window… Didn’t work

But the last one set me on the way to the solution. When we were in the Modules window(Debug –> Windows –> Modules), it was clear that the DLL was not loaded. Clicking load symbols and selecting the PDB file failed with the following error message “A matching symbol is missing”.

I realized that the issue could be related to the XAP file not being updated for one or other reason. After removing the existing XAP file and rebuilding, debugging worked fine.

Integrating MS Project Server with Team Foundation Server 2010

An official story about integrating MS Project Server with TFS 2010 is finally there. Microsoft has  just released a CTP demonstrating integration between Team Foundation Server 2010 and Project Server 2010.

There is not much information available yet, but to get you going:  

Impress your colleagues with your knowledge about…the TextFieldParser class

Sometimes when working with C# you discover some hidden gems. Some of them very useful, other ones a little bit harder to find a good way to benefit from their functionality. One of those hidden gems that I discovered some days ago is the TextFieldParser class.

This class is well hidden in the Microsoft.VisualBasic namespace – which makes it not very accessible for the C# developer – although there’s nothing VB.NET specific about it. It makes it very easy to process filetypes like CSV and similar formats.

A quick sample:

   1:  using (var csvFile = new TextFieldParser(myFilePath)  
   2:  {   
   3:        csvFile.TextFieldType = FieldType.Delimited;   
   4:        csvFile.SetDelimiters(",");   
   5:        csvFile.CommentTokens = new[] { "HEADER" };  
   6:       
   7:        while (!csvFile.EndOfData)  
   8:        {  
   9:            string[] fieldArray;  
  10:            try  
  11:            {  
  12:                fieldArray = csvFile.ReadFields();  
  13:            }  
  14:            catch (Microsoft.VisualBasic.FileIO.MalformedLineException ex)  
  15:           {  
  16:                // TODO: Handle exception  
  17:                continue;  
  18:            }  
  19:            // TODO: process values in fieldArray  
  20:        }  
  21:   }

Some characteristics of this class:

  • There are several constructor overloads, so you can point it to a file path or a stream or TextReader.
  • TextFieldParser implements IDisposable, so you can use it in a "using" block to automatically close the file or stream when finished.
  • The delimiter value can be specified using the  SetDelimiters method.
  • The CommentTokens property is used to tell TextFieldParser to ignore lines where the text begins with one of the specified strings.

Visual Studio 2010: ALM article

Too much free time during the holidays? Certainly check out this great article about enabling ALM with Visual Studio 2010 in the Visual Studio Magazine.

Saturday, July 3, 2010

TFS 2010 API: Connecting to a TFS collection using a specific user

Just a quick code snippet to describe how to authenticate with a specific user to a TFS collection:

   1:  TfsTeamProjectCollection collection = new TfsTeamProjectCollection( 
   2:          new Uri(http://tfs:8080/tfs/DefaultCollection, 
   3:          new System.Net.NetworkCredential(@"domain_name\username", "password")); 
   4:   
   5:  collection.EnsureAuthenticated(); 

TFS 2010 DLL location

If you want to write your own applications that integrate with the Team Foundation Server environment, you’ll need some DLL’s to access the TFS Object Model and API’s.

With the 2010 release the location where these DLL’s live has changed to:

  • C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0

Something to remember…

Microsoft ALM site

Microsoft has added a new section  to the MSDN site focusing on the ALM aspects of Visual Studio.  If you are looking for anything that’s related to ALM and Visual Studio, this should be the first place to look.

Check it out: http://msdn.microsoft.com/visualstudioalm

TFS 2010 bug in upgrade process

Last week after upgrading a TFS 2008 environment to TFS 2010, we discovered that our merge history was no longer correct. After some investigation I found this post by Brian Harry where he explains that their is a bug in the TFS upgrade process.

'”We have discovered a potentially serious issue that can affect upgrades from TFS 2005 or TFS 2008 to TFS 2010.  The issue is triggered by a specific pattern of labels, renames, deletes and/or branches that existed before the upgrade.  Once the upgrade is complete the contents of the affected labels could be incorrect.  Also some internal merge tracking data could be incorrect, resulting in the need to reapply previous merges.” 

There is already a hot fix available here: http://code.msdn.microsoft.com/KB2135068. Apply the fix after the initial installation, but before you start the Team Foundation Server configuration. Therefore uncheck the “Launch Team Foundation Server Configuration Tool” checkbox at the end of the installation. 

Unfortunately you probably will only discover the issue when you start doing merges. So I suggest to run the scripts attached to Harry’s post to see if your environment is impacted. They describe it as a rare problem, but I was already able to reproduce the problem in 2 environments!

DB2 Error codes

One of the things that make working with IBM DB2 hard, are the very useful(read: useless) errorcodes you get back. No other information is returned so you don’t have a clue what’s going on.

To find the corresponding error message, you have two options:

  1. Browse to the IBM site and search for the error. For people who have already tried finding their way in this site, it’s very easy to get lost.
  2. Search for the error message using the DB2 tools.

Let’s have a look at the second option:

  • Open a DB2 command window
  • Execute "db2 ? [errorcode]"

One sample. When the Error Code was SQL0668N than execute:

   1:  db2 ? SQL0668N


This will return a list of reason codes and their explanation.

Free Visual Studio 2010 Database Edition for Oracle

A lot of developers among us have to work with Oracle databases. Unfortunately the Visual Studio 2008 Database Edition only supported SQL Server databases. With the release of Visual Studio 2010, Quest, the organization behind well-known database tools like TOAD, have released a database edition plugin that supports Oracle. This Toad Extension for Visual Studio 2010 even supports more features than the SQL Server version!

To make it even better, Quest has just released their FREE version of the Toad Extension for Visual Studio 2010. Developers with a Visual Studio 2010 Professional License can now manage database change under source control as they can for SQL Server.

Important remark: Developers that use Visual Studio Premium and Ultimate, still need the Commercial version of Toad Extension for Visual Studio.

Debugging databinding

WPF and Silverlight are great thanks to the rich databinding support. Important to notice is that late bound data binding is used bindings in XAML files. This feature allows a DataContext to be set at run-time and the objects within that DataContext to resolve their property bindings then. This late binding enables cool features like DataTemplates, composable applications and run-time loading of loose XAML.

A side effect of late bound binding resolution that databinding will fail silently if a value can not be found.  So troubleshooting why a specific field is not loaded in a control can be painfull. Therefore some tips to get some useful debugging information.

View the Debug Output Window

If you have the DataContext set, any data bindings within that DataContext that can't be resolved will be listed in the Debug Output Window at run-time.

WPF Trace Settings, Data Binding

The default value of the WPF Trace Settings, Data Binding is "Error." To get more data binding information change the level to "Warning". If the value is set to "Error" you won't see any of the PresentationTraceSources.TraceLevel warning messages.

To change the WPF Trace Settings, Data Binding value to "Warning," navigate to Tools, Options, Debugging, Output Window, WPF Trace Settings, Data Binding and set the value to Warning.

PresentationTraceSources.TraceLevel

Introduced to WPF in .NET 3.5 SP1, the PresentationTraceSources.TraceLevel attached property allows developers to dial up the amount of information outputted in the Debugger Output Window for a binding.

The below XAML snippet shows how to apply the PresentationTraceSources.TraceLevel attached property to a binding. 

   1:  <Window 
   2:      xmlns:diag="clr-namespace:System.Diagnostics;assembly=WindowsBase"
   3:      xmlns:local="clr-namespace:DebugDataBindings"
   4:      x:Class="DebugDataBindings.MainWindow"
   5:      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
   6:      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
   7:      Title="MainWindow" Height="350" Width="525">
   8:      <Grid x:Name="layoutRoot">
   9:          <Grid.Resources>
  10:              <local:DebugConverter x:Key="debugConverter" /> 
  11:          </Grid.Resources>
  12:          <TextBox 
  13:              Text="{Binding Path=Customer.FirstName, diag:PresentationTraceSources.TraceLevel=High}"   
  14:              Height="23" HorizontalAlignment="Left" Margin="90,18,0,0" VerticalAlignment="Top" Width="120"/>
  15:      </Grid>
  16:  </Window>

Still not enough information? Have a look at the following blog posts: