This may not work for you, but instead of compiling the code and then calling mage to create the click once, you'll need to do this using msbuild.
Using MSBUILD, there's a publish target you can call to get this working. E.x.: msbuild WindowsFormsApplication5.sln /t:publish