Thank you for your post.
Some clarification with you
Could you please descript your concern more clarifier?
Regarding your description, I created a new project and would like to reproduce your scenario, but it worked well on my machine.
I write an app to simulate C# compiler. It could execute this app.
I would recommend that you could please check the following link, which talks about how to programmatically compile code using C# compiler.
Hope this helps! If you have any issues, please feel free to let me know.