.NET Reflector Pro build 381 (and older versions too) can't decompile a specific assembly for me here. It decompiles to about 54% and then throws an exception.

It is a third party assembly built for .Net CF 2.0 and i use it from a desktop project. Unfortunally i have neither the source nor a desktop framework version of the assembly.

This assembly itself is only dependend to mscorlib and System:

mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac

and

Name: System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=969db8053d3322ac, Retargetable=Yes

.NET Reflector Pro chokes at decompiling with a FileNotFoundException. I guess it is not able to find the referenced CF assemblies.

Because the Microsoft CF assemblies are retargetable it should use mscorlib and System of the .Net desktop version.

If you right-click and "Go to assembly" on mscorlib and System under the references of this assembly Reflector correctly goes to the desktop assemblies.

Here is the full stack trace of the exception (there is strange garbage at the end, this didn't happen in older builds):

System.IO.FileNotFoundException: Could not load the assembly System ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 4849, offset:107 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 7118, offset:49 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 5074, offset:162 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 6397, offset:80 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9292, offset:218 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9290, offset:254 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9283, offset:61 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3814, offset:150 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3794, offset:41 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3787, offset:722 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3918, offset:71 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3788, offset:26 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3787, offset:750 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3768, offset:54 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9066, offset:41 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9282, offset:44 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9054, offset:603 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3936, offset:224 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3893, offset:32 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3934, offset:161 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3955, offset:37
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
--- End of inner exception stack trace ---
at ‘.
gunters
0

Comments

5 comments

  • gunters
    gunters wrote:
    .NET Reflector Pro build 381 (and older versions too) can't decompile a specific assembly for me here. It decompiles to about 54% and then throws an exception.

    I could reproduce the problem with a minimal test case.

    First i created a new solution with a Visual C# Smart Device Project. I made a class library targetting Windows CE for .Net Compact Framework Version 2.0.

    The class had the following source code:
    using System;
    using System.Collections.Generic;
    
    namespace Test1
    {
        public class Class1
        {
            public int Mul(int x, int y)
            {
                return x * y;
            }
    
            public string Now()
            {
                LinkedList<DateTime> t = new LinkedList<DateTime>();
                t.AddFirst(DateTime.Now);
                return t.Last.ToString();
            }
        }
    }
    

    I used LinkedList to force a reference to System assembly.

    I build the assembly and saved it to some other place.

    Then i created another solution, this time with a C# console project targeting desktop 2.0 .Net.

    I referenced the CF assembly built in the first step (Add reference, browse) and inserted the follwing code into Program.cs:
        class Program
        {
            static void Main(string[] args)
            {
                Test1.Class1 c = new Class1();
                Console.WriteLine(c.Mul(3, 4));
                Console.WriteLine(c.Now());
                Console.ReadLine();
            }
        }
    

    Then i selected "Coose assemblies to debug" from the Reflector menu. I checked the CF Test1 assembly built in the first step and now referenced from a desktop .Net project. And the decompilation choked with the same error as before, here is it again:

    System.IO.FileNotFoundException: Could not load the assembly System ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 4849, offset:107 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 7118, offset:49 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 5074, offset:162 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 6397, offset:80 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 8626, offset:115 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 5750, offset:78 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9723, offset:582 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9657, offset:4583 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9658, offset:2081 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9751, offset:267 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 9647, offset:707 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3936, offset:190 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3893, offset:32 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3934, offset:161 ---> SmartAssembly.SmartExceptionsCore.UnhandledException: SmartExceptionsCore.UnhandledException @ 3955, offset:37
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    --- End of inner exception stack trace ---
    at ‘.
    gunters
    0
  • Alex D
    Thanks a lot for the report, we'll make sure this gets fixed!
    Alex D
    0
  • gunters
    Alex.Davies wrote:
    Thanks a lot for the report, we'll make sure this gets fixed!

    Cheers!

    I would really glad to be able to debug and step thru this dreaded assembly :)
    gunters
    0
  • Alex D
    I've just tried it on the latest build, and I think someother fixes we've done have had the side effect of fixing this problem. Let me know if it works for you.

    Thanks,
    Alex D
    0
  • gunters
    A quick test with build 484 worked now. I'll tell you if i still get any problems.

    Thanks very much!
    gunters
    0

Add comment

Please sign in to leave a comment.