Reflector: How to Add a WP7 Assembly List

by Jason Haley 1. December 2011 05:59

Since Reflector doesn’t offer the option of choosing a set of Windows Phone 7 assemblies to start out with, I put together my own.  This blog entry walks you through the two ways to adding this to your own Reflector setup.

imageFirst a little about Assembly Lists – since some people are not aware of this functionality in Reflector.  If you go to the File menu and select Open Assembly List…, you will get the Assembly List Management dialog showing you the different assembly lists you have configured on your machine.  If you haven’t set any up, the only item you’ll see in this list is “—Default—“.

An assembly list is a listing of assemblies that are loaded in the assembly browser tree.  So if you find that you need multiple configurations of this tree or need different versions of the same thing for different reasons (like a Silverlight 4 and a .Net 4) – you may want to add an assembly list with those assemblies so you can keep the tree the way you need it for future usage and just switch between assembly lists when you need to.

In my case, I keep an assembly list for Silverlight 4, .Net 4 and when I’m deep in development or just spending a lot of time in Reflector, I’ll create an assembly list for whatever I’m working on … which is why I found the need to setup a Windows Phone 7 assembly list.

Here are the two options to get the WP7 assembly list into your Reflector setup:

Option 1 – Edit Your Reflector.cfg file

Under the covers the assembly lists are just lines in the Reflector.cfg file that follow a specific format (“<path to the assembly>|<assembly list name>”) and located in order under the [AssemblyManager] section. 

1.  Close Reflector if it is open

2.  Locate your Refelctor.cfg file.  On Windows 7 it is located in the following directory: 
    C:\Users\<username>\AppData\Local\Red Gate\.NET Reflector 7

3.  Open the Reflector.cfg file in a text editor and locate the [AssemblyManager] section of the file

4.  Scroll to the bottom of it and add these lines:

"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\Microsoft.Phone.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\Microsoft.Phone.Interop.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\Microsoft.Phone.Reactive.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\mscorlib.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Core.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\system.data.linq.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Device.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Net.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Observable.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Runtime.Serialization.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.ServiceModel.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.ServiceModel.Web.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Windows.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Xml.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Xml.Linq.dll|WP7"
"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\System.Xml.Serialization.dll|WP7"

5.  Save the Reflector.cfg file

6.  Open Reflector, and go to the File –> Open Assembly List…

You should now see the WP7 option, like shown below:

SNAGHTML2aaff14

Option 2 – Use Assembly List Import*

The Assembly List Import/Export functionality is part of the PowerCommands functionality – which means unless you have it enabled you won’t set the menu item.  If you go to the Tools –> Options you can enable the Import/Export AssemblyList command (shown below).

SNAGHTML2af7423

1. Download the WP7AssemblyList.xml file and save it to a location you can remember

2.  Go to the File menu –> Import/Export AssemblyList –> Import

image

This will launch the Open file dialog.

3.  Choose the WP7AssebmlyList.xml file you downloaded and click Open

This will open the Import/Export Assembly List dialog.

***WARNING – If you don’t follow #4 you will loose any assembly lists you already have saved ***

4.  Uncheck the “Hide existing Assembly List items” checkbox at the bottom and check the WP7 node of the tree to import all the assemblies listed in the xml file.

SNAGHTML2b788cc

5.  Click Import

6. Close Reflector – this saves the changes to the Reflector.cfg file.

7. Open Reflector, and go to the File –> Open Assembly List…

You should now see the WP7 option, like shown below:

SNAGHTML2aaff14

Comments (0) | Post RSSRSS comment feed |

Categories: Reflector
Tags:

Updates to PowerCommands for Reflector Project

by Jason Haley 17. December 2010 11:43

I’ve made a few updates to the PowerCommands for Reflector project. 

The downloads page is here:http://powercommands.codeplex.com/releases/view/32414

I fixed a few small bugs, added some functionality to the existing Open Zip command and added 4 new commands.  Here’s a quick summary of the changes (minus the bug fixes):

Extended the Open Zip Command

imageFirst change was to allow xap files to also be opened.  This means you can now open a xap file by going to the File –> Open Zip menu item, click the Browse… button and then select the xap file extension in the filter dropdown in the lower right of the open file dialog.

Second change was to wire up a drag/drop event handler to the assembly browser.  This means you can now drag a file to the assembly browser (zip or xap) and the Opened Zip Assembly dialog will open allowing you to choose which assemblies in the compressed file you want to add.

 

Added Red Gate Forum and Stackoverflow Tag Commands

imageI borrowed this idea from VS where on the help menu you can go to the MSDN forums.  Since I check both the Red Gate Forum and the Stackoverflow tag for Reflector a few times a week, I thought it might be a nice addition … plus I’m not too sure people know about them.

 

 

 

 

Added Open Xaml in VS2010 and Open Xaml in Notepad Commands

imageI’ve wanted to add stuff to the context menu in the resource viewer/disassembler for awhile but have found the code needed to do so too much of a hack for me.  Last night as I was going to sleep, it finally hit me that I could just create a submenu off the resource context menu to accomplish what I wanted to.  These commands extract a xaml file that has been stuck into an embedded resource.  My first attempt was the Open Xaml in VS 2010 … then I found it a bit annoying due to the designer – so I created the Open Xaml in Notepad, which is much faster and all I really needed.

Comments (0) | Post RSSRSS comment feed |

Categories: Reflector
Tags:

Updated PowerCommands for Reflector

by Jason Haley 20. May 2010 15:18

I just added a new set of commands to the PowerCommands for Reflector project.  They are now 3 new commands that make it easier to open a .resources file in Visual Studio (supports VS 2005, 2008 and 2010).  The command is useful when you want to get at multiple resources embedded in a .resources file.  Instead of writing my own editor/viewer/extractor I thought VS would make more sense (and be a lot less work on my part).

In order to enable the commands, you’ll need to do the following:

1.  Go to the View menu –> Options…

2.  Choose Power Commands from the listing

3.  In the command listing, scroll down and check the options you want turned on – there are 3 versions of VS supported so there are 3 options. 

NOTE: Don’t forget to verify the Program Files directory – it is used to launch the devenv.exe.

4.  Click OK

Now when you right click on a resource that is a .resources file, you will get the option on the context menu to Open in Visual Studio.

image

Comments (1) | Post RSSRSS comment feed |

Categories: Reflector
Tags:

Updated Reflector.PowerCommands

by Jason Haley 5. January 2010 16:46

I just updated the Reflector.PowerCommands project with the latest minor release. 

This release adds Import/Export capability to the Query Editor.

image 

To Export a Query image

Export works with the currently loaded query.  So you will need to either open an existing query first or type one … otherwise the export the query information and an empty query text.

When you have the query you want to export open

1.  Click the export button and the Export Query dialog will show (below)

image

2.  Edit the query information you want to export and click OK.

3.  Then the Save As dialog will show, give the export file a name and click Save.

To Import a Query image

1.  Click the import button and the Open File dialog will open

2.  Find the xml file with the exported query in it and click Open

The Query will be added to you local cache.

If you want to try an import, you can use this one:
http://jasonhaley.com/files/InstantiatedByFilterByNamespace.xml

It is a query I wrote for someone in the Reflector forum to search through a given namespace for methods that instantiate a specific type … basically a filtered “InstantiatedBy” that the Analyze functionality in Reflector already does.  The example uses the namespace of “System.Net” and searches for methods that use “System.IO.Stream” and writes it to the output window.

Comments (1) | Post RSSRSS comment feed |

Categories: Reflector
Tags: