Created
January 8, 2016 04:06
-
-
Save jesulink2514/fc4dbf0e68eebc0af8fe to your computer and use it in GitHub Desktop.
Compilar C# con C#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//set the compiler options to use 3.5 version of assemblies | |
Dictionary<string,string> compilerOptions=new Dictionary<string, string>(); | |
compilerOptions.Add("CompilerVersion", "v3.5"); | |
// Select the code provider | |
CSharpCodeProvider codeProvider = new CSharpCodeProvider(compilerOptions); | |
CompilerParameters compilerparams = new CompilerParameters(); | |
// we dont want to generate an executable | |
compilerparams.GenerateExecutable = false; | |
// Save the assembly as a physical file. | |
compilerparams.GenerateInMemory = true; | |
//add reference to any assemblies that are in different location | |
compilerparams.ReferencedAssemblies.Add("System.Core.dll"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment