It's not difficult, but it's going to be fiddly.
First create a "template" of the application as a file - create a basic forms project, and combine all the program.cs, and form.cd, form.designer.cs files into a single file called template.cs
Then your application can use that as a base for the application you want to produce. Write the modified file as "MyApp.cs" and try the command line:
%FrameworkDir%\v4.0.30319\csc.exe MyApp.cs
via Process.Start (you may need to change the version detail for the Framework available on the PC).
This should produce an exe: MyApp.exe.
But do not try to do this in the root directory! Access to this is restricted for security reasons and producing an exe file there is very unlikely to succeed. Create an "open permission" folder and do it all there.