Search code examples
compact-frameworkilspy

ILSpy on .net Compact Framework


In ILSpy version 2.3.1.1855, I'm trying to decompile System.dll (to troubleshoot a problem with HttpWebRequest). This dll is in C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE. I get a list of types and members, but no code. Instead, this exception shows in the ILSpy code window:

ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Net.WebResponse System.Net.WebRequest::GetResponse() ---> System.OverflowException: Array dimensions exceeded supported range. at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDefinition methodDef) at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDefinition methodDef, Boolean optimize, DecompilerContext context) at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters) at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDefinition methodDef, DecompilerContext context, IEnumerable`1 parameters) --- End of inner exception stack trace --- at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDefinition methodDef, DecompilerContext context, IEnumerable`1 parameters) at ICSharpCode.Decompiler.Ast.AstBuilder.CreateMethod(MethodDefinition methodDef) at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethod(MethodDefinition method) at ICSharpCode.ILSpy.CSharpLanguage.DecompileMethod(MethodDefinition method, ITextOutput output, DecompilationOptions options) at ICSharpCode.ILSpy.TextView.DecompilerTextView.DecompileNodes(DecompilationContext context, ITextOutput textOutput) at ICSharpCode.ILSpy.TextView.DecompilerTextView.<>c__DisplayClass16.b__15()

Any hints?


Solution

  • Those are just stubs. You need to decompile the actual BCL libraries, for example:

    C:\Program Files (x86)\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL\System.dll