Read the README that’s included as part of the XAML Toolkit CTP.
The big thing to note is that FxCop 10 Beta 2 does not currently support Silverlight. You’ll have to use FxCop 1.36 and force it to run in .NET 4 to get things to work for Silverlight. If you’re running WPF, FxCop 10 should be fine. (FxCop 10 RC & RTM wills support Silverlight)
After running FxCop, add the XAML Rule
Go to the folder where you installed the XAML Toolkit (C:\Program Files\Microsoft XAML Toolkit\) and add Microsoft.Xaml.Tools.FxCop.dll
You should see all the XAML rules added in the Rules section:
Add your Silverlight/WPF assembly and hit F5 (or Analyze). You may get a popup about finding System.Windows.dll. Have it point to C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0
WPF users can point to PresentationFramework/PresentationCore/WindowsBase in C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0
You may also need to point FxCop towards System.Windows.Controls.dll which can be found in: C:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client
If everything goes smoothly you should see the rules run:
You should be able to do similar things for adding your own custom rules to FxCop as well.
One of the most common requests I had at PDC was to be able check if your WPF XAML was Silverlight friendly and vice versa. Over the next few weeks, I’ll try working on some simple rules to validate WPF/Silverlight compatibility and whether you can use the XAML between the two platforms.