I had an experience this week with .NET where most of the day was spent working with the configuration and setup rather than on the business logic. I was working with a team to implement the web service security framework I’ve been developing. There are a number of assemblies in the project – one http module, a metadata module and another with the WSE filters. The team I was working with were trying to use the ‘Copy Local’ property of assembly references in Visual Studio to copy assemblies from a central third party assembly directory to the project’s local folders. This was the root of many of our problems, as the better way to achieve this goal is to use the GAC.
We basically ran into problems because we redeployed updated assemblies to the local project, rather than the central third party assembly directory. When we compiled our project it overwrote our updated assemblies in the local project with the older assemblies in the third party directory. It took us a while to understand that this was going on. We first noticed that the updated assemblies had been replaced with older assemblies. We removed all of the references from Visual Studio but it was still happening. A MCS consultant gave us some assistance and showed how to use Ildasm.exe to view the assembly manifest – this shows what the assembly knows about rather than what Visual Studio knows about. This then helped us work out what was going on.
I really enjoy picking up tips using Ildasm.exe to see what's going on under the covers. I find working around others is a great way of doing this. Knowing what's going on under the covers takes a lot of work, but it's rewarding when the knolwedge helps solve problems. Eric sink has just written a great article on the benefits of understanding what's going on under the covers rather than relying on higher level tools.
Tools like reflector and Ildasm.exe are great at getting a handle on what is going on under the covers. Yesterday I read the readme to reflector and realised that you can use it to display which virtual functions are overridden locally in a class and which are inherited by the base class (shown by different coloured member names). It’s also possible to search for all references to a member within the loaded assemblies. I think this is the best tool for browsing projects – better than the object browser and the class view combined. This screen shot shows how you can find sub types as well as seeing which methods are implemented locally (black members) and those that are implemented in base classes (green).
