vb.net Replace existing class with CodeDoms generated class
<p>I've class like this (it's just example)</p>

<pre><code>class child
   inherits parent1
end class
</code></pre>

<p>and then at runtime i want change become like this</p>

<pre><code>class child
   inherits grandfatherclass
end class
</code></pre>

<p>I've been trying with code like this, sadly it's still inherits from parent1</p>

<pre><code>Dim onewclass As CodeDomProvider = CodeDomProvider.CreateProvider("VB")
Dim objCompilerParameters As New CodeDom.Compiler.CompilerParameters
Dim classString as string = "class child" &amp; vbnewline &amp; _
                            "     inherits grandfatherclass" &amp; vbnewline &amp; _
                            "end class"
onewclass.CompileAssemblyFromSource(objCompilerParameters, classString)
</code></pre>

<p>Is it possible to replace existing class with CodeDom generated class...?</p>