Created
June 1, 2012 21:34
-
-
Save c1982/2855259 to your computer and use it in GitHub Desktop.
Generate Assembly
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
private string GenerateAssembly(string username, string password, string _assemblyPath) | |
{ | |
var _result = ""; | |
using (var csc = new CSharpCodeProvider(new Dictionary<string, string>() { { "CompilerVersion", "v3.5" } })) | |
{ | |
var parms = new CompilerParameters(new[] { "mscorlib.dll", "System.Core.dll", "FluentMigrator.dll" }); | |
parms.GenerateExecutable = false; | |
parms.OutputAssembly = _assemblyPath; | |
CompilerResults r = csc.CompileAssemblyFromSource(parms, AssemblyString(username, password)); | |
r.Errors.Cast<CompilerError>().ToList().ForEach(error => _result += error.ErrorText); | |
} | |
return _result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment