Esempio n. 1
0
        /// <summary>
        /// Compiles script into assembly with CSExecutor
        /// </summary>
        /// <param name="scriptFile">The name of script file to be compiled.</param>
        /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
        /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
        /// <returns></returns>
        public static string Compile(string scriptFile, string assemblyFile, bool debugBuild)
        {
            CSExecutor exec = new CSExecutor();

            exec.Rethrow = true;
            return(exec.Compile(scriptFile, assemblyFile, debugBuild));
        }
Esempio n. 2
0
        /// <summary>
        /// Compiles script into assembly with CSExecutor and loads it in current AppDomain
        /// </summary>
        /// <param name="scriptFile">The name of script file to be compiled.</param>
        /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
        /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
        /// <returns></returns>
        public static Assembly Load(string scriptFile, string assemblyFile, bool debugBuild)
        {
            CSExecutor exec = new CSExecutor();

            exec.Rethrow = true;
            string outputFile = exec.Compile(scriptFile, assemblyFile, debugBuild);

            AssemblyName asmName = AssemblyName.GetAssemblyName(outputFile);

            return(AppDomain.CurrentDomain.Load(asmName));
        }
 /// <summary>
 /// Compiles script into assembly with CSExecutor
 /// </summary>
 /// <param name="scriptFile">The name of script file to be compiled.</param>
 /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
 /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
 /// <returns></returns>
 public static string Compile(string scriptFile, string assemblyFile, bool debugBuild)
 {
     CSExecutor exec = new CSExecutor();
     exec.Rethrow = true;
     return exec.Compile(scriptFile, assemblyFile, debugBuild);
 }
        /// <summary>
        /// Compiles script into assembly with CSExecutor and loads it in current AppDomain
        /// </summary>
        /// <param name="scriptFile">The name of script file to be compiled.</param>
        /// <param name="assemblyFile">The name of compiled assembly. If set to null a temnporary file name will be used.</param>
        /// <param name="debugBuild">true if debug information should be included in assembly; otherwise, false.</param>
        /// <returns></returns>
        public static Assembly Load(string scriptFile, string assemblyFile, bool debugBuild)
        {
            CSExecutor exec = new CSExecutor();
            exec.Rethrow = true;
            string outputFile = exec.Compile(scriptFile, assemblyFile, debugBuild);

            AssemblyName asmName = AssemblyName.GetAssemblyName(outputFile);
            return AppDomain.CurrentDomain.Load(asmName);
        }