private Assembly CompileSourceFiles(
			IEnumerable<string> sourceFilePathes,
			IEnumerable<string> referenceAssemblies,
			TextWriter outputWriter,
			ColorizedTextWriter errorWriter
			)
		{
			var compilerParameters =
				new CompilerParameters
				{
					GenerateExecutable = false,
					IncludeDebugInformation = false,
					GenerateInMemory = true,
					OutputAssembly = "MsgPackSerializers",
					TreatWarningsAsErrors = this.TreatWarningsAsErrors,
					WarningLevel = this.WarningLevel
				};

			foreach ( var referenceAssembly in referenceAssemblies )
			{
				compilerParameters.ReferencedAssemblies.Add( referenceAssembly );
			}

			if (
				!typeof( CodeDomProvider ).Assembly.CodeBase.StartsWith(
					Environment.ExpandEnvironmentVariables( "file:///%SystemDrive%/Windows/" ),
					StringComparison.OrdinalIgnoreCase ) )
			{
				// may be mcs, so add C# 3.5 option.
				compilerParameters.CompilerOptions = "-langversion=3 -sdk=2";
			}

			var results =
				CodeDomProvider.CreateProvider( "C#" ).CompileAssemblyFromFile(
					compilerParameters,
					sourceFilePathes.ToArray()
					);

			foreach ( var stdout in results.Output )
			{
				outputWriter.WriteLine( stdout );
			}

			outputWriter.Flush();

			foreach ( CompilerError error in results.Errors )
			{
				string message =
					String.Format(
						CultureInfo.CurrentCulture,
						"Source '{1}'{0}  Line:{2}, Column:{3}{0}  {4}{0}{5}",
						Environment.NewLine,
						error.FileName,
						error.Line,
						error.Column,
						error.ErrorNumber,
						error.ErrorText
						);

				if ( error.IsWarning )
				{
					errorWriter.WriteWarning( message );
				}
				else
				{
					errorWriter.WriteError( message );
				}
			}

			errorWriter.Flush();

			return results.CompiledAssembly;
		}
		private Assembly CompileSourceFiles(
			IEnumerable<string> sourceFilePathes,
			IEnumerable<string> referenceAssemblies,
			TextWriter outputWriter,
			ColorizedTextWriter errorWriter
			)
		{
			var compilerParameters =
				new CompilerParameters
				{
					GenerateExecutable = false,
					IncludeDebugInformation = false,
					GenerateInMemory = true,
					OutputAssembly = "MsgPackSerializers",
					TreatWarningsAsErrors = this.TreatWarningsAsErrors,
					WarningLevel = this.WarningLevel
				};

			foreach ( var referenceAssembly in referenceAssemblies )
			{
				compilerParameters.ReferencedAssemblies.Add( referenceAssembly );
			}

			var results =
				CodeDomProvider.CreateProvider( "C#" ).CompileAssemblyFromFile(
					compilerParameters,
					sourceFilePathes.ToArray()
					);

			foreach ( var stdout in results.Output )
			{
				outputWriter.WriteLine( stdout );
			}

			outputWriter.Flush();

			foreach ( CompilerError error in results.Errors )
			{
				string message =
					String.Format(
						CultureInfo.CurrentCulture,
						"Source '{1}'{0}  Line:{2}, Column:{3}{0}  {4}{0}{5}",
						Environment.NewLine,
						error.FileName,
						error.Line,
						error.Column,
						error.ErrorNumber,
						error.ErrorText
						);

				if ( error.IsWarning )
				{
					errorWriter.WriteWarning( message );
				}
				else
				{
					errorWriter.WriteError( message );
				}
			}

			errorWriter.Flush();

			return results.CompiledAssembly;
		}