Compile a .cs file which is located in different folder of the disk from another .cs program
<p>i want to compile a .cs program which exist in some other folder on the disk and generate a .dll of it, using another .cs program or a console application or a window application. i tried using the following </p>

<pre><code>using (StreamReader textReader = new StreamReader(@"path\Filename.cs"))
{
     textFile = textReader.ReadToEnd();
    Console.WriteLine(textFile);
}
CodeDomProvider codeProvider = new CSharpCodeProvider(); 
ICodeCompiler compiler = codeProvider.CreateCompiler(); 
// add compiler parameters 
CompilerParameters compilerParams = new CompilerParameters();
compilerParams.CompilerOptions = "/target:library /optimize"; 
compilerParams.GenerateExecutable = false; 
compilerParams.GenerateInMemory = true;             
compilerParams.IncludeDebugInformation = false; 
compilerParams.ReferencedAssemblies.Add("mscorlib.dll");
compilerParams.ReferencedAssemblies.Add("System.dll");  
// compile the code 
CompilerResults results = compiler.CompileAssemblyFromSource(compilerParams,        textFile);
</code></pre>
