Comments
Sort by recent activity
Thanks for the report. I've added it to our bug tracking system. / comments
Thanks for the report. I've added it to our bug tracking system.
Hi.
In the first example, the code is defining an Enumerable using the yield form. The C# compiler code generates this by defining an anonymous class which implements a state machine that generates the items. Currently, Reflector does not decompile this state machine back into code that uses the yield statement.
In the second example, the CS$0$0002 is a temporary variable that the C# compiler has generated. These symbols are present in a pdb file associated with the assembly. Reflector will use the names from the pdb file if it can find it, but only if the option View/Options/Disassembler/Show PDB symbols is checked. Unchecking the option will get rid of the variable. / comments
Hi.
In the first example, the code is defining an Enumerable using the yield form. The C# compiler code generates this by defining an anonymous class which implements a state machine that generates...
No. You'll have to hand edit it to get it to compile. / comments
No. You'll have to hand edit it to get it to compile.
I can now reproduce what you're seeing.
It happens if the 3.5 application is decompiled in a situation where the 4.0 version of System.Core is included in the assembly set. I imagine you have an assembly list set up for .NET 4 and have opened the 3.5 assembly in that set.
I didn't see it because I had System.Core 3.5 selected in my loaded assemblies since I was using a 3.5 framework set of assemblies in my assembly list.
I'll look into it. The workaround is to set up a .NET 3.5 assembly list, using say, File/Open List, Add, Framework35, double-click framework 35, select the 3.5 framework. Opening the assembly within this group of pre-loaded assemblies should give you the behaviour you are looking for. / comments
I can now reproduce what you're seeing.
It happens if the 3.5 application is decompiled in a situation where the 4.0 version of System.Core is included in the assembly set. I imagine you have an as...
Using View/Options to turn the optimization down to .NET2 gives something pretty close to the original. int num = source.Where<string>(delegate (string item) {
return (item.Length == 3);
}).Count<string>();
/ comments
Using View/Options to turn the optimization down to .NET2 gives something pretty close to the original. int num = source.Where<string>(delegate (string item) {
...
Hi.
Could you send me a self-contained example of the failure to decompile? As far as I know, that support for .net 4 should not have changed anything in this area.
If I take the code you gave and compile it, I see public ReflectorExample()
{
List<string> list = new List<string> { "One", "Two", "Three" };
(from item in list
where item.Length == 3
select item).Count<string>();
}
unless I have the optimisation level (View/Options/Optimization) set to less than 3.5. / comments
Hi.
Could you send me a self-contained example of the failure to decompile? As far as I know, that support for .net 4 should not have changed anything in this area.
If I take the code you gave and ...
The types named like "<>f__AnonymousType0" are the anonymous types that the compiler generates for code such as the following
int[] items = new int[] { 1, 2, 3, 4 };
var result = items.Select(x => new { A = x });
where it needs to generate a class with a property A for holding the result of the select.
If I compile the above code and de-compile using Reflector, with the View/Options/Optimization set to 3.5 I get
int[] items = new int[] { 1, 2, 3, 4 };
var result = from x in items select new { A = x };
but if I set it to 1.0, Reflector no longer tries to get rid of the anonymous types and I see
var result = new int[] { 1, 2, 3, 4 }.Select((CS$<>9__CachedAnonymousMethodDelegate1 != null) ? CS$<>9__CachedAnonymousMethodDelegate1 : (CS$<>9__CachedAnonymousMethodDelegate1 = new Func<int, <>f__AnonymousType0<int>>(MainWindow.<Test>b__0)));
}
If you have the optimization level set to 3.5, then it is a bug if Reflector is not getting rid of the anonymous types. Do you have a reproducible example we can have a look at to debug this?
In your example, the new { stategroup = stategroup, state = state } is the type the compiler is generating as <>f__AnonymousType0 - this instance is then being passed into the Where and the StoryBoard is being pulled out of the state component and returned. / comments
The types named like "<>f__AnonymousType0" are the anonymous types that the compiler generates for code such as the following
int[] items = new int[] { 1, 2, 3, 4 };
var result = items.Select(x => ...
In the normal case, all you need to do is to attach Visual Studio to the w3wp.exe and use the "Choose assemblies to debug" menu item to select the assembly that you wish to debug.
Try that. If regeneration is needed, you'd be prompted after that dialog. / comments
In the normal case, all you need to do is to attach Visual Studio to the w3wp.exe and use the "Choose assemblies to debug" menu item to select the assembly that you wish to debug.
Try that. If rege...
Yes it is possible.
When the debugger is attached to an application, say to w3wp.exe after "Attach to process", using the "Choose assemblies to debug" option will allow you to generate debugging information for assemblies that are used. We adjust the symbol search path so that Visual Studio will find and use this debugging information in the subsequent debugging session.
This all becomes more complicated if the assembly you want to debug doesn't have a debugger signature. This signature is information contained in the headers that debuggers use to link the pdb and the assembly. We have a process that we call "regeneration" which rebuilds an assembly to add the necessary signature and gives you a new assembly. When you have a project, we offer the chance of automatically substituing references to this new assembly, but in this case you would need to get this new assembly loaded instead of the original. / comments
Yes it is possible.
When the debugger is attached to an application, say to w3wp.exe after "Attach to process", using the "Choose assemblies to debug" option will allow you to generate debugging in...
The system will do this regeneration if you select an assembly without a debugger signature in the "choose assemblies to debug..." dialog.
You should just attach to the w3wp.exe and then try to select the assembly you are interested in for debugging. / comments
The system will do this regeneration if you select an assembly without a debugger signature in the "choose assemblies to debug..." dialog.
You should just attach to the w3wp.exe and then try to sel...