private void GetExeFile(string link)
{
Process compiler = new Process();
compiler.StartInfo.FileName = @"C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe";
compiler.StartInfo.Arguments = link + @"C:\Users\khan\Documents\Visual Studio 2012\Projects\Calculator\Calculator.sln /t:build /r:System.dll /out:sample.exe stdstr.cs";
compiler.StartInfo.UseShellExecute = false;
compiler.StartInfo.RedirectStandardOutput = true;
compiler.Start();
txtGetContent.Text = compiler.StandardOutput.ReadToEnd();
compiler.WaitForExit();
You need to quote the solution filename because it has spaces in:
compiler.StartInfo.Arguments = link + @"""C:\Users\khan\Documents\Visual Studio 2012\Projects\Calculator\Calculator.sln"" /t:build /r:System.dll /out:sample.exe stdstr.cs";
This is just how argument parsing works - it's not really C# specific.
See more on this question at Stackoverflow