ILSpy is using cecil along with it's own libraries to accomplish this, i have heard that .NETReflector is using his own private algorithm to generate the higher level c#,f#,vb code from MSIL, any methods/references on how to do this without dependencies ?
EDIT: i'm now satified with ILSpy and cecil as a backbone
SOLUTION:
string GetSourceCode(string path) {
var asmDef = AssemblyDefinition.ReadAssembly(path);
var strBuilder = new StringBuilder();
foreach (var type in asmDef.MainModule.Types) {
if (!type.IsCompilerGenerated()) {
AstBuilder builder = new AstBuilder(new DecompilerContext(asmDef.MainModule));
builder.AddType(type);
var output = new StringWriter();
builder.GenerateCode(new PlainTextOutput(output));
strBuilder.Append(output.ToString());
output.Dispose();
}
}
return strBuilder.ToString();
}