Red Gate Reflector some times do not show code ofuscated with Red gate Smartassembly. Why?
Refector is only accurate with IL produced by the Microsoft C# compiler.
IL produced via any other means (e.g., another language) may not
be accurately decompiled.
The best free "decompiler" is Telerick JustDecompile
Hate to disagree
Can you debug managed code with JustDecompile ?
ILSpy 2.0 (beta) is a
debugger as well as a decompiler.
You can set breakpoints, launch an executable or attach
to a running process, and step through any code in any
assembly that's loaded, regardless of whether it is your
code, the .NET framework, or AutoCAD's managed runtime.
When a breakpoint is hit, you can examine the call stack,
see the values of arguments, etc. (no locals/watch window
yet, but that's planned).
Also, it looks like Telerik still has some work to do.
JustDecompile showing the source for System.Linq.Enumerable.ZipIterator:
Current member / type: System.Collections.Generic.IEnumerable`1<TResult> System.Linq.Enumerable::ZipIterator(System.Collections.Generic.IEnumerable`1<TFirst>,System.Collections.Generic.IEnumerable`1<TSecond>,System.Func`3<TFirst,TSecond,TResult>)
File path: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\System.Core.dll
Product version: 2012.1.214.2
Multiple invocations of finally method
at ˆ..ˆ(€ handlerInfo, Queue`1 bfsQueue, ILogicalConstruct currentNode)
at ˆ..‡(€ handlerInfo)
at ˆ..ƒ(BlockLogicalConstruct theBlock)
at ˆ.Ž–.‰()
at ˆ.Ž–.Process(DecompilationContext context, BlockStatement body)
at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language)
at Telerik.JustDecompiler.Decompiler.Extensions.DecompileYieldStateMachine(MethodBody body, ILanguage language, YieldFieldsInformation& fieldsInformation)
at .‹.()
at .‹.Match(StatementCollection statements)
at .‹.Process(DecompilationContext context, BlockStatement body)
at Telerik.JustDecompiler.Decompiler.DecompilationPipeline.Run(MethodBody body, ILanguage language)
at Telerik.JustDecompiler.Decompiler.Extensions.(DecompilationPipeline pipeline, ILanguage language, MethodBody body, DecompilationContext& context)
at Telerik.JustDecompiler.Decompiler.Extensions.Decompile(MethodBody body, ILanguage language, DecompilationContext& context)
at Telerik.JustDecompiler.Languages.BaseImperativeLanguageWriter.Write(MethodDefinition method)
at Telerik.JustDecompiler.Languages.BaseLanguageWriter.Write(IMemberDefinition member, Boolean showCompilerGeneratedMembers)
at JustDecompile.CodeViewer.CodeWriter.Write() in c:\Builds\126\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.CodeViewer\Writers\CodeWriter.cs:line 32
at JustDecompile.CodeViewer.ViewModels.CodeViewerViewModel.(AssemblyMemberNode member, CancellationToken cancellationToken) in c:\Builds\126\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.CodeViewer\ViewModels\CodeViewerViewModel.cs:line 170
mailto: JustDecompilePublicFeedback@telerik.com
ILSpy showing the same method:
// System.Linq.Enumerable
private static IEnumerable<TResult> ZipIterator<TFirst, TSecond, TResult>(IEnumerable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
{
using (IEnumerator<TFirst> enumerator = first.GetEnumerator())
{
using (IEnumerator<TSecond> enumerator2 = second.GetEnumerator())
{
while (enumerator.MoveNext() && enumerator2.MoveNext())
{
yield return resultSelector(enumerator.Current, enumerator2.Current);
}
}
}
yield break;
}