George,
Fortunately you cannot! As Herfried states, partial classes need to be
within the same assembly & an assembly needs to be compiled all at once.
The "best" you can do is inherit from TheClass "on the fly" to extend it
You can use either the System.CodeDom namespace or the
System.Reflection.Emit namespaces to generate executables "on the fly".
Generally I favor System.CodeDom over System.Reflection.Emit.
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"George Meng" <ge************@sohu.com> wrote in message
news:%2********************@tk2msftngp13.phx.gbl.. .
| Is there a way to build partial class on the fly, the partial class then
| extend the class which is already complied?
|
| For example: I have a class
|
| public class TheClass
| ......
| End Class
|
| Then at the runtime, I generate the partial class:
|
| partial public class TheClass
| ......
| End Class
|
| And let the two class work together?
|
| George
|
|