The following is my code :
using System;
using System.Collections.Generic;
using System.Text;
using System.CodeDom.Compiler;
using System.IO;
using Microsof
I believe this is the problem:
string content = File.ReadAllText(@"D:\hi.cs");
string[] code = new string[content.Length];
char[] seperators = { '\n','\r','\t' };
code = content.Split(seperators);
The idea (I believe) is that CompileAssemblyFromSource doesn't take individual lines - each string in the array is meant to be a complete C# source file. So you probably just need:
string[] code = new[] { File.ReadAllText(@"D:\hi.cs") };
Note that even if your first block were doing the right thing, you'd still have been creating a string array for no reason - it would have been simpler to write it as:
string content = File.ReadAllText(@"D:\hi.cs");
char[] seperators = { '\n','\r','\t' };
string[] code = content.Split(seperators);