Comments
9 comments
-
I'm sorry that you've found this bug in reflector pro when it tries to read assemblies from the project. If you've submitted it to us, we'll be able to take a look and hopefully fix it for the next version.
Thanks, -
Thanks for the quick reply!
Should you need any further information please just leave a post in this thread (I enabled notifications, they are sent to my work e-mail address). I would gladly help you if it helps solving the issue more quickly, because I just lost 2 days not understanding .NET CF behavior. Had I been able to use Reflector, that problem would have probably been solved in 2 hours. So as soon as Reflector Pro will start working in my solution, I am going to buy it.
How often do you usually release a new version / how often should I take a look at the download section and see if it works for me? -
Hi Tim,
I've now fixed the bug in the code, and version 6.3 or above (which will be somewhere between 1 and 2 months to release) will fix it.
It is caused by a reference in your solution which reflector couldn't find the location of. These normally have a little yellow warning icon on them in the solution explorer. As a workaround, have a look for those.
If not, another workaround would be to use the "Browse" button in reflector's "choose assemblies to debug" dialog (which you can open from VS without your solution loaded) to decompile the assembly. If you then open your solution, the assembly will still be decompiled and you'll be able to debug through it.
Cheers, -
Great, that did the trick (damn you, you single old reference in one of the ~50 projects *shake fist*).
Sadly, I now am running into a different problem. After choosing the assemblies I tell .NET Reflector to do the reference switch. I hit F5 to start debuggin and VS2008 recompiles the solution, but every project fails to compile, stating
"The predefined type "System.Object" is not defined or imported." (exact wording may be wrong, I am using a german version of VS).
Also, no matter which assembly in the references I click on and choose "display in object browser" and then "Go To Decompiled Definition", I do only see empty methods / properties and their Attributes.
This also happens when I create a new solution with only one .NET CF project.
I hope you can also help me on this one. -
Tim,
Which assemblies did you try to decompile? If mscorlib was among them, I understand the error about System.Object. Perhaps it decompiled the versions of assemblies in the "Reference Assemblies" folder, which are empty assemblies.
Incidentally, the bug you first found was introduced when I tried to find and fix reference assemblies being decompiled, so I'm hoping that the reference assemblies aren't to blame here. I don't have any other ideas for the empty methods though.
Cheers, -
Alex,
I chose all the assemblies which are referenced automatically when you create a new "Device Application" for Inelligent Devices under .NET CF 3.5, which are:
mscorlib
System
System.Core
System.Data
System.Data.DataSetExtension
System.Drawing
System.Windows.Forms
System.Xml
System.Xml.Linq
Interestingly, accordingly to the path shown by the .NET Reflector when choosing the assemblies to debug, all those assemblies are located in
C:\Programme\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE
but mscorlib shows the following path:
C:\WINDOWS\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_de_b77a5c5661934e089\mscorlib.resources.dll
Again, this is a freshly created project without me touching anything. When I chose all assemblies BUT mscorlib, the project would compile and debugging would start, but when executing the first line
Application.Run(new Form1());
I get a MissingMethodException stating the type "System.Windows.Forms.Form" could not be loaded from assembly 'System.Windows.Forms, Version 3.5.0.0, Culture=neutral, PublicKeyToken=AB7C72e8DD6F2B88'.
I tried to disassemble the assemblies outside of Visual Studio just using Reflector. I opened System.Windows.Forms.dll at the location above, and it disassembled to empty methods again.
However, when I closed all assemblies in Reflector and restarted it and selected .NET CF 3.5 (from the standard dialog that pops up when you start Reflector and it has no assemblies opened), all assemblies within there (System.Windows.Forms.dll, too) will disassemble just fine. The difference is that they are located in a different directory:
%ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL
This time, even the mscorlib.dll is taken from that location.
Blindly guessing I would suspect something wrong with path(variable)s or the .NET (CF) installations on my machine.
I hope I am not distracting you from your work too much, but I highly appreciate your help!
[edit] Edit says that I cleared the the debug store and the directory containing the regenerated assemblies every time before attempting a new disassemble/debug to be sure that no faulty caching would be to blame.[/edit] -
Interesting. You could try using the "Browse" button to decompile the copy of the assemblies in the folder that you say worked in Reflector:
%ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL
Let me know if that works, -
It worked, I was able to look through the disassembled code perfectly fine within VS2008, but I wasn't able to debug with it, though, because Reflector did not offer me to switch assemblies (they were not placed in the regenerated assemblies folder either, so no manual switching). I tried to create a new project, cleared all refereneced assemblies and replaced them with those working for disassembling. The project built successfully, but Reflector again didn't offer me to switch them.
On a side node: disassembling those assemblies took significantly longer (about 3 to 5 times longer) than disassembling the default assemblies. -
Well, as a workaround I seemed to be able to get it working doing these steps:
- Replacing the .dll and .xml files in %ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v3.5\WindowsCE with those from %ProgramFiles%\Microsoft.NET\SDK\CompactFramework\v3.5\Debugger\BCL
- in VS 2008 under Tools -> Options -> Debugging -> Symbols -> untick the option to only search places when loading symbols manually
That way, I was able to debug through the assemblies, except for the mscorlib. But those assemblies from \BCL are significantly larger, so I'm afraid to deliver debug-assemblies; I will revert for now, but I hope this information is helpful for you.
Add comment
Please sign in to leave a comment.
I am trying to use the .NET Reflector Pro Trial within our current project to see if we can put it to use. The solution consist of a number of projects targetting .NET CF 2.0 and .NET CF 3.5 as well as one CAB Installer project and one Resources project. However I am not able to use the Reflector in this project. Whenever I try to choose the assemblies to debug, shortly after trying to read the assemblies for my project, the Reflector reports an error (it's a german text with indicates a NullReferenceException) and asks me to report it to Red Gate.
I was able to successfully chose the assemblies in a fresh solution both in .NET 3.5, .NET CF 2.0 and .NET CF 3.5. (I wasn't able to debug afterwards; VS would not compile the code because it could not find the class System.Object after replacing the assemblies).
I also tried to convert the .NET CF 2.0 projects into .NET CF 3.5 projects to see if that would resolve the issue, but it didn't.
I am a bit stuck there, because I don't know what might cause those errors (there is no error log for Reflector).
Any help would be appreciated.
Best Regards,
Tim