In my application I compile another program from source.cs file using CodeDom.Compiler and I embed some resources ( exe and dll files ) at compile time using :
File.WriteAllBytes(@"C:\Users\admin\Desktop\MyFile.exe", Resources.BinFile); // binary file File.WriteAllText(@"C:\Users\admin\Desktop\text.txt", Resources.TextFile); // text file