So I had a very kind E-mail from a chap called Patrick Smacchia the other day offering me a free professional license for his software NDepend. There were no strings attached, he simply offered “I would be glad to offer you a pro license. This way you can use the tool and explain its capabilities on your blog if you find it useful”. I was a tad sceptical at first so did a little research and found out what it is; the description was a little cryptic – essentially it’s a suite of tools with its own language that allows you to analyse your code to find out more information e.g. number of lines of code in certain sections, code or framework dependencies, what are the most complex or largest functions etc. This essentially can help you understand the complexity and quality of your code which can help you improve it.
The product looks extremely powerful – not only can you use a set of
600 200 odd rules you can also write your own using its own version of Linq. Now I’m sure many people who read my blog regularly (I have no idea how many regulars I have but I’m guessing it’s actually quite a small number) but those that do will see that I often cover rare but convoluted issues (or sometimes simple ones that have just not been documented); you may not know, however, that I code mostly on my own. It’s for this reason that I thought NDepend probably won’t help me too much as I figure it’s more team oriented, and so I communicated this to Patrick but as I said – the offer was completely no strings attached and so I figured why not give it a go.
Hence I’m now writing this article. I don’t know if there will be any more to come as I have no idea if I’ll like the product or find it useful but I guess we’ll just have to wait and see. My first experience so far is, obviously, installation. This should be relatively straight forward (copy it to a folder not in Program Files and run the installer) but for a pedant like me it threw up a few issues – notably it couldn’t install from Program Files because some DLL’s were blocked, so here’s the solution:
- First download the install from: http://www.ndepend.com/NDependDownload.aspx
- Unzip the zip file and copy to C:\Program Files\NDepend (or C:\Program Files (x86)\NDepend if you’re running 64-bit Windows like me)
- Download streams.exe from http://technet.microsoft.com/en-us/sysinternals/bb897440.aspx and copy it to C:\Program Files
- Run a Command Line as administrator (Start -> type cmd then right click and select Run As Administrator)
- Type C:\Program Files (or C:\Program Files (x86) if running 64-bit Windows) and hit enter
- Type “streams –s –d NDepend” and hit enter
- Now in Windows Explorer navigate to C:\Program Files\NDepend (or C:\Program Files (x86)\NDepend) and double-click NDepend.Install.VisualStudioAddin.exe
- Alongside the appropriate version of Visual Studio click Install
- You can now delete streams.exe from your Program Files folder if you wish!
Now when you load Visual Studio you should see a new menu has appeared called NDepend. I’ll give this a trial over the new few weeks and if I find anything worth writing about then I’ll add it to the blog!