Adding XAP file causes exception

3 posts, 0 answers
  1. Carl
    Carl avatar
    8 posts
    Member since:
    Feb 2011

    Posted 28 Apr 2011 Link to this post

    I decided to add a WP7 xap file just to see what happened...

    ---------------------------
    Error
    ---------------------------
    An error has occurred. Please, report this exception to the Telerik team (Use CTRL + C to copy the text). Thanks in advance!

     

    System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. ---> System.AggregateException: One or more errors occurred. ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

       at Mono.Cecil.PE.ImageReader.ReadImage() in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil.PE\ImageReader.cs:line 83

       at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil.PE\ImageReader.cs:line 672

       at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil\ModuleDefinition.cs:line 876

       at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil\ModuleDefinition.cs:line 859

       at JustDecompile.Navigation.Views.CodeTreeView.(AssemblyNode assemblyNode) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 215

       at JustDecompile.Navigation.Views.CodeTreeView.??(? nodeType, AssemblyNode assemblyNode, AssemblyNamespace assemblyNamespace, AssemblyMemberDefinition assemblyMemberDefinition) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 174

       at JustDecompile.Navigation.Views.CodeTreeView..?.?() in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 162

       at System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj)

       at System.Threading.Tasks.Task.Execute()

       --- End of inner exception stack trace ---

       at System.Threading.Tasks.Task`1.get_Result()

       at JustDecompile.Navigation.Views.CodeTreeView.??(Task`1 task, RadTreeViewItem treeViewItem) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 187

       at System.Threading.Tasks.Task.Execute()

       --- End of inner exception stack trace ---

       at System.Threading.Tasks.TaskExceptionHolder.Finalize()

    ---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

       at Mono.Cecil.PE.ImageReader.ReadImage() in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil.PE\ImageReader.cs:line 83

       at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil.PE\ImageReader.cs:line 672

       at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil\ModuleDefinition.cs:line 876

       at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil\ModuleDefinition.cs:line 859

       at JustDecompile.Navigation.Views.CodeTreeView.(AssemblyNode assemblyNode) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 215

       at JustDecompile.Navigation.Views.CodeTreeView.??(? nodeType, AssemblyNode assemblyNode, AssemblyNamespace assemblyNamespace, AssemblyMemberDefinition assemblyMemberDefinition) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 174

       at JustDecompile.Navigation.Views.CodeTreeView..?.?() in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 162

       at System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj)

       at System.Threading.Tasks.Task.Execute()

       --- End of inner exception stack trace ---

       at System.Threading.Tasks.Task`1.get_Result()

       at JustDecompile.Navigation.Views.CodeTreeView.??(Task`1 task, RadTreeViewItem treeViewItem) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 187

       at System.Threading.Tasks.Task.Execute()

    ---> (Inner Exception #0) System.BadImageFormatException: Format of the executable (.exe) or library (.dll) is invalid.

       at Mono.Cecil.PE.ImageReader.ReadImage() in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil.PE\ImageReader.cs:line 83

       at Mono.Cecil.PE.ImageReader.ReadImageFrom(Stream stream) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil.PE\ImageReader.cs:line 672

       at Mono.Cecil.ModuleDefinition.ReadModule(Stream stream, ReaderParameters parameters) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil\ModuleDefinition.cs:line 876

       at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) in c:\B\Behemoth\JustDecompile Production Build\Sources\Decompiler\Mono.Cecil\Mono.Cecil\ModuleDefinition.cs:line 859

       at JustDecompile.Navigation.Views.CodeTreeView.(AssemblyNode assemblyNode) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 215

       at JustDecompile.Navigation.Views.CodeTreeView.??(? nodeType, AssemblyNode assemblyNode, AssemblyNamespace assemblyNamespace, AssemblyMemberDefinition assemblyMemberDefinition) in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 174

       at JustDecompile.Navigation.Views.CodeTreeView..?.?() in c:\B\Behemoth\JustDecompile Production Build\Sources\UI\JustDecompile.Navigation\Views\CodeTreeView.xaml.cs:line 162

       at System.Threading.Tasks.Task`1.InvokeFuture(Object futureAsObj)

       at System.Threading.Tasks.Task.Execute()<---

    <---

    ---------------------------
    OK  
    ---------------------------


    That's what happened!

    I got excited because it displayed refreshing animation in the tree so I thought it was going to work!
  2. Todd Anglin
    Todd Anglin avatar
    2040 posts
    Member since:
    Aug 2005

    Posted 28 Apr 2011 Link to this post

    Hello Carl-

    Thanks for reporting the feedback. This is a very interesting idea! We'll consider adding direct support for XAPs in the future.

    In the meantime, a XAP is really just a ZIP file. You can load the assemblies in your Silverlight XAP with JustDecompile Beta TODAY if you follow these steps:

    1. Make a copy of your XAP and rename the extension from .XAP to .ZIP
    2. Extract the contents of the ZIP to a folder
    3. Open the folder and you should see all of the DLLs for your Silverlight application
    4. Drag and drop these Silverlight DLLs in to JustDecompile
    5. Browse and have fun!

    Hope that helps.

    -Todd
  3. DevCraft banner
  4. Carl
    Carl avatar
    8 posts
    Member since:
    Feb 2011

    Posted 28 Apr 2011 Link to this post

    Hi,

    Thanks for your response.

    I don't think I really expected it to work, to be honest. It was just that dotfuscator was taking a xap as input and producing a xap at the end and I was wanting to compare the two!

    Might be a pretty neat idea though...

    Carl
Back to Top