private void Compile()
        {
            k.RefAssemblies.Clear();

            Assembly s  = Assembly.LoadFile(@"C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll");
            Assembly s1 = Assembly.LoadFile(@"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll");

            k.RefAssemblies.Add(s);
            k.RefAssemblies.Add(s1);
            var AssembliesList = ManiPulateMainClass.GetAssemblyNames(textBox1.Text);


            foreach (var assembly in AllAssemblyFiles)
            {
                foreach (string CodeAssembly in AssembliesList)
                {
                    if (CodeAssembly != "System")
                    {
                        if (assembly.Contains(CodeAssembly))
                        {
                            k.RefAssemblies.Add(Assembly.LoadFile(assembly));
                        }
                    }
                }
            }

            UpdateList update = new UpdateList(UpdateUI);

            this.Invoke(update, k.RefAssemblies, CompilationClass.Classname(textBox1.Text));


            k.CompilationError += new ErrorEventHandler(k_CompilationError);
            k.CompileCSharp(textBox1.Text, "Sample.exe");
            //button1.Enabled = true;
        }
示例#2
0
        private void Compile()
        {
            k.RefAssemblies.Clear();

            Assembly s  = Assembly.LoadFile(@"C:\assemblies\mscorlib.dll");
            Assembly s1 = Assembly.LoadFile(@"C:\assemblies\System.Core.dll");

            k.RefAssemblies.Add(s);
            k.RefAssemblies.Add(s1);



            var AssembliesList = ManiPulateMainClass.GetAssemblyNames(t);



            //foreach (var assembly in AllAssemblyFiles)
            //{
            //    foreach (string CodeAssembly in AssembliesList)
            //    {

            //        if (CodeAssembly != "System")
            //        {
            //            if (assembly.Contains(CodeAssembly))
            //            {
            //                k.RefAssemblies.Add(Assembly.LoadFile(assembly));
            //            }
            //        }

            //    }
            //}

            UpdateList update = new UpdateList(UpdateUI);

            this.Invoke(update, k.RefAssemblies, CompilationClass.Classname(t));

            // k.CompilationError += new ErrorEventHandler(k_CompilationError);
            // k.CompileCSharp(t, "Sample.exe");
        }