any solution/suggest for this problem using .NET Reflector ver 6.5.0.135?
Comments
3 comments
-
Hi.
The code you are seeing is generated by the C# compiler when the original code defines an Enumerator that uses "yield return". The code seems to be doing:foreach(DictionaryEntry entry in ...) { yield return entry; }
We are currently looking at how to generate a better decompilation for this construct. -
Thanks for you Clive...In order to re-compile the source,what can I do to know at minimal a object or I just can delete the source and making my own object?
-
There will be code somewhere that makes an instance of the compiler generated class.
public IEnumerable<DictionaryEntry> Foo(...) { <GetEnumerator>d__0 d__ = new <GetEnumerator>d__0(-2); d__.<>4__this = this; // maybe other arguments here }
You can get rid of the compiler generated code if you change that definition to be:public IEnumerable<DictionaryEntry> Foo(...) { foreach(DictionaryEntry item in ...) yield return item; }
Add comment
Please sign in to leave a comment.