Transfering properties from one object to another with similar definition
<p>There must be an easier way...</p>

<pre><code>    void TransferFrom(object obj) {
        foreach(PropertyInfo prop in this.GetType().GetProperties()) {
            prop.SetValue(this, obj.GetType().GetProperty(prop.Name).GetValue(obj, null), null);
        }
    }
</code></pre>

<p>I have two separate libraries with the same object definition - all property names/types are the same. Is the above the only way to copy the values or is there another way? I'm unable to reference one of the dlls and the object to be copied is passed as an object rather than a distinct type. </p>
