I will reply not to your exact question but instead to how to solve the underlying problem. To me it seems you're building some sort of "installer" that should simply unpack some other program, right?
On the fly compilation in this case is a bad idea for a number of reasons. It can be much slower and needs to carry the whole code around up to the user machine and would rely on the user to have a compatible environment. PDBs would also be useless since they would be generated at the user site. Instead you should always compiled in your computers and then just deliver those binaries, which is also much simpler to code.
One possible approach would be to include the target exe within the installer as an embedded resource. Add the .exe to be deployed from its build folder into the installer project and switch it to be embedded resource which will include the whole file inside the other. Then at runtime you just read from it and save somewhere else.
For that you can use the GetManifestResourceStream
method (Look at its documentation for the details), together with normal file writing routines to extract it at the user site. This question also deals with this particular topic. With this technique the installer will just read the file within itself and save it to a location of your choice, much like extracting a compressed file like most installers do, but using the precompiled code instead.