Derik Whittaker

Syndication

News


Reflector to the rescue…AGAIN

As I was trying to complete the integration of a new feature into our application I figured it was about time that I fired up the service (the app is a windows service for background processing).  Low and behold when I did all hell broke lose.  Yes, I have spent almost 2 weeks working on the feature and have yet to do a full end to end test, but this is not an issue as I feel comfortable that my feature will work since my coverage is high and my test count is also high.

When I started to look into the issue I noticed the following in my error logs

Could not load file or assembly 'nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77' or one of its dependencies.

This error made no damn sense, because why would I need to reference NUnit for a production dll (no, we are not using compile arguments to turn on/off NUnit)????  I knew the issue, some dll had reference to NUnit when it should not.  But hunting this down was going to be a bear (our product has about 20-25 dlls, and 5 or 6 solution files).  I had 2 choices, either open up each solution file and look at the references for EVERY dll… OR use reflector. 

Some of you may not realize, but reflector not only allows you to peer into the source code of a dll, but it also allows you to quickly analyze the dependencies (and their dependencies) of a dll.  So, about 3 minutes after I fired up Reflector I knew the which dll was the issue and was able to replace it (I had completely forgot that in a lazy haze I added nunit to one of my projects as I was too lazy to move over to the test project to do a simply POC test ((yes I am VERY lazy)) )

So the next time you find yourself needing to determine dependencies, remember there are many ways to solve this problem, but Reflector may be your best bet.

Till next time,


Posted 11-11-2009 7:09 AM by Derik Whittaker

[Advertisement]

Comments

Andriy Buday wrote re: Reflector to the rescue…AGAIN
on 11-11-2009 11:16 AM

Agree that Reflector is great tool for such things.

I did not catch one thing. Are there possibility to load in tool couple of dlls and then request if some references particular one. Or did you checked each of them manually?

Andriy Buday wrote re: Reflector to the rescue…AGAIN
on 11-11-2009 11:17 AM

Agree that Reflector is great tool for such things.

I did not catch one thing. Are there possibility to load in tool couple of dlls and then request if some references particular one. Or did you checked each of them manually?

Derik Whittaker wrote re: Reflector to the rescue…AGAIN
on 11-11-2009 11:32 AM

@Andriy,

No, i have to load each assembly (drag and drop) and check each one.

Bill Sorensen wrote re: Reflector to the rescue…AGAIN
on 11-11-2009 1:28 PM

You might want to check out Peli's Graph add-in for Reflector. It shows assembly dependency graphs.

reflectoraddins.codeplex.com/wikipage

Boyko Stanev wrote re: Reflector to the rescue…AGAIN
on 11-12-2009 8:44 AM

You can use the assembly binding log viewer, which is a very useful tool and is part of Visual Studio. In VS command prompt type "fuslogvw" and then start your application to see which assemblies are/not loaded and who wanted/tried to load them. See msdn.microsoft.com/.../e74a18c4%28VS.71%29.aspx

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)