Possible Duplicate:
How to programatically build and compile another c# project from the current project
Lets say we have an application named Program1.exe so when i click that exe that program has to create another exe lets say Program2.exe which write "hello world" on screen. So I think its possible using command line tool of visual studio using csc command in code, anyway if its possible can that Program2.exe replace Program1.exe? I mean that Program1.exe can re-compile in runtime?