Make a Clone of My.Settings
<p>VB2012: I am trying to make a clone (not a copy) of the My.Settings class. I tried the DeepClone function found here on SO</p>

<pre><code>Public Function DeepClone(Of T)(ByVal a As T) As T
    Using stream As New System.IO.MemoryStream
        Dim formatter As New BinaryFormatter
        formatter.Serialize(stream, a)
        stream.Position = 0
        Return DirectCast(formatter.Deserialize(stream), T)
    End Using
End Function
</code></pre>

<p>but it results in an exception </p>

<blockquote>
  <p>Type 'MyCompany.MyDept.TestApp.My.MySettings' in Assembly
  'TestApp, Version=10.1.0.3, Culture=neutral, PublicKeyToken=null' is
  not marked as serializable.</p>
</blockquote>

<p>Being the settings are a class and saved as XML there must be a way to clone them or am I just barking up the wrong tree?</p>

<p>~AGP</p>