private ProjectCompiler RunCode_CompileCode(CompilerProjectReader projectReader, string assemblyFilename, string sourceFile) { ProjectCompiler compiler = new ProjectCompiler(CompilerManager.Current.Win32ResourceCompiler, CompilerManager.Current.ResourceCompiler); //try //{ compiler.SetOutputAssembly(assemblyFilename + ".dll"); //compiler.AddSource(new CompilerFile(sourceFile)); compiler.AddSource(new CompilerFile { File = sourceFile }); //if (projectReader != null) // compiler.SetProjectCompilerFile(projectReader.GetProjectCompilerFile()); // CompilerDefaultValues from runsource.runsource.config.xml runsource.runsource.config.local.xml //compiler.SetParameters(GetRunSourceConfigCompilerDefaultValues(), runCode: true); compiler.SetParameters(projectReader, runCode: true); compiler.SetTarget("library"); CompilerManager.Current.UpdateAssemblies(compiler.Assemblies.Values); compiler.Compile(); return(compiler); }
public static ProjectCompiler Create(string projectFile, Win32ResourceCompiler win32ResourceCompiler, ResourceCompiler resourceCompiler = null) { ProjectCompiler compiler = new ProjectCompiler(win32ResourceCompiler, resourceCompiler); CompilerProjectReader projectReader = CompilerProjectReader.Create(new XmlConfig(projectFile).GetConfigElementExplicit("/AssemblyProject")); compiler.SetParameters(projectReader); compiler.SetProjectCompilerFile(projectReader.GetProjectCompilerFile()); return compiler; }
public static ProjectCompiler Create(string projectFile, Win32ResourceCompiler win32ResourceCompiler, ResourceCompiler resourceCompiler = null) { ProjectCompiler compiler = new ProjectCompiler(win32ResourceCompiler, resourceCompiler); CompilerProjectReader projectReader = CompilerProjectReader.Create(new XmlConfig(projectFile).GetConfigElementExplicit("/AssemblyProject")); compiler.SetParameters(projectReader); //compiler.SetProjectCompilerFile(projectReader.GetProjectCompilerFile()); return(compiler); }
private ProjectCompiler RunCode_CompileCode(CompilerProjectReader compilerProject, string assemblyFilename, string sourceFile) { ProjectCompiler compiler = new ProjectCompiler(CompilerManager.Current.Win32ResourceCompiler, CompilerManager.Current.ResourceCompiler); //try //{ compiler.SetOutputAssembly(assemblyFilename + ".dll"); compiler.AddSource(new CompilerFile(sourceFile)); if (compilerProject != null) compiler.SetProjectCompilerFile(compilerProject.GetProjectCompilerFile()); // CompilerDefaultValues from runsource.runsource.config.xml runsource.runsource.config.local.xml //compiler.SetParameters(GetRunSourceConfigCompilerDefaultValues(), runCode: true); compiler.SetParameters(compilerProject, runCode: true); compiler.SetTarget("library"); CompilerManager.Current.UpdateAssemblies(compiler.Assemblies.Values); compiler.Compile(); return compiler; }