Пример #1
0
        public CompilerResults Compile(String sourceFile, String code, String assemblyFile, StringCollection referencedAssemblies)
        {
            Error.AssertString(code, nameof(code), false);
            CodeDomProvider    compiler   = this.GetCompiler();
            CompilerParameters parameters = this.GetParameters(assemblyFile, referencedAssemblies);

            if (compiler.IsNull() || parameters.IsNull())
            {
                return(null);
            }
            CompilerResults compilerResults = compiler.CompileAssemblyFromSource(parameters, new String[] { code });

            this.AssertResult(sourceFile, compilerResults);
            return(compilerResults);
        }