title: UITestException not marked as serializable
body: <p>I am trying to a create coded UI test for my WPF program but I get this exception when I click Generate Code:</p>
  
  <blockquote>
    <p>Type
    'Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException' in
    Assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension,
    Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is
    not marked as serializable.</p>
  </blockquote>
  
  <p>Steps I followed:</p>
  
  <ol>
  <li>I created an example solution, put only a button in the WPF form</li>
  <li>Ran the program</li>
  <li>Added a coded UI test project to my solution</li>
  <li>Started recording</li>
  <li>Clicked the button</li>
  <li>Paused recording</li>
  <li>Clicked "Generate Code" and then "Add and Generate"</li>
  </ol>
  
  <p>This is when I get the exception. How can I solve this problem?</p>