Navigation

Search

Popular Posts

My Dot Net Developer’s tools
Removing unused CSS
Using Test Impact Analysis
Creating MSDN like help

Twitter Updates

Categories

On this page

My Dot Net Developer’s tools list, and more…
Removing unused CSS Classes from your web application

Archive

Blogroll

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 34
This Year: 3
This Month: 0
This Week: 0
Comments: 17

Sign In

 Saturday, May 23, 2009
Saturday, May 23, 2009 4:42:33 PM (Mountain Standard Time, UTC-07:00) ( asp.net | Better Developer | utilities )

I gave a brownbag presentation at my current client recently about the common tools (in addition to Visual Studio), that I use on a regular basis for working with .NET or web development in general. I also threw in some non-development tools that are a part of my day to day life and make things easier. Here’s the complete list:

Note: For a completely awesome and Ultimate Developer’s tool list, be sure to check out Scott’s blog post.

 

.NET

 

Name

Description

Comments

ClrProfiler

The CLR Profiler includes a number of very useful views of the allocation profile, including a histogram of allocated types, allocation and call graphs, a time line showing GCs of various generations and the resulting state of the managed heap after those collections, and a call tree showing per-method allocations and assembly loads.

Working with Cassini

DebugDiag

The Debug Diagnostic Tool (DebugDiag) is designed to assist in troubleshooting issues such as hangs, slow performance, memory leaks or fragmentation, and crashes in any Win32 user-mode process. The tool includes additional debugging scripts focused on Internet Information Services (IIS) applications, web data access components, COM+ and related Microsoft technologies.

Troubleshooting .Net 2.0 memory leaks.

FxCop

FxCop is a code analysis tool that checks .NET managed code assemblies for conformance to the Microsoft .NET Framework Design Guidelines.

 

LibCheck

This tool allows you to compare two versions of an assembly, and determine the differences. The tool reports the differences as a combination of 'removed' and 'added' APIs.

 

NDepend

NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze code structure, specify design rules, plan massive refactoring, do effective code reviews and master evolution by comparing different versions of the code.

Has Academic, commercial versions.

PEX

Right from the Visual Studio code editor, Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Pex performs a systematic analysis, hunting for boundary conditions, exceptions and assertion failures, which you can debug right away. Pex enables Parameterized Unit Testing, an extension of Unit Testing that reduces test maintenance costs.

Reflector

.NET Reflector enables you to easily view, navigate, and search through, the class hierarchies of .NET assemblies, even if you don't have the code for them. With it, you can decompile and analyze .NET assemblies in C#, Visual Basic, and IL.

Be sure to check out the Addins

Regulator

The Regulator is an advanced Regular expressions testing tool, featuring syntax highlighting and web-service integration with Regexlib.com's database of online regular expressions.

 

Resharper

ReSharper provides solution-wide error highlighting on the fly, instant solutions for found errors, over 30 advanced code refactorings, superior unit testing tools, handy navigation and search features, single-click code formatting and cleanup, automatic code generation and templates.

  • Free 30 day trial, Full Edition: $199, C# Edition: $149.
  • CodeRush Express is a similar free alternative, but I prefer Resharper.

SandCastle

Enables managed class library developers to easily create accurate, informative documentation with a common look and feel.

Simple how-to.

ViewState Helper

Lets you debug ViewState issues by displaying Page and viewstate details for an asp.net page.

Alternative

Web Development Helper

Web Development Helper is a free browser extension for Internet Explorer that provides a set of tools and utilities for the Web developer, esp. Ajax and ASP.NET developers. The tool provides features such as a DOM inspector, an HTTP tracing tool, and script diagnostics and immediate window.

 

WinDbg

Microsoft Windows Debugger (WinDbg) is a powerful Windows-based debugging tool. It is capable of both user-mode and kernel-mode debugging.

Excellent blog to learn more.

 

 

Web Development

 

Name

Description

Comments

CssCleaner

Detect unused css classes in your website (static analysis).

Written by yours truly :). Need to add more features to this and maybe change the UI to WPF.

Design

Design is a suite of web-design and development assistive tools which can be utilised on any web-page. Encompassing utilities for grid layout, measurement and alignment, Design is a uniquely powerful JavaScript bookmarklet.

 

Fiddler

Fiddler logs all HTTP(S) traffic between your computer and the Internet and Fiddler allows you to inspect all HTTP(S) traffic, set breakpoints, and "fiddle" with incoming or outgoing data. Fiddler includes a powerful event-based scripting subsystem, and can be extended using any .NET language.

Firebug

Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse. You can edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.

JSLint

With JavaScript Lint, you can check all your JavaScript source code for common mistakes without actually running the script or opening the web page.

 

XRAY

XRAY is a bookmarklet for Internet Explorer 6+, and Webkit and Mozilla based browsers (including Safari, Firefox, Camino or Mozilla). Use it to see the box model for any element on any web page.

 

Xenocode.com

Run any browser (IE 6-8, FF 2,3, Opera, Chrome, Safari) directly from the web.

  • This is the best and easiest way I have seen to run multiple versions of IE on your box, but their service seems to be down lately.
  • Other options are to use a virtual machine or a program like Multiple IE.

 

 

SQL Development

 

Name

Description

Comments

AnjLab SqlProfiler

SQL Server Express Edition Profiler provides the most of functionality standard profiler does, such as choosing events to profile, setting filters, etc.

This is good while working with Sql Server Express, which does not come with a profiler.

SqlAssist

Adds Sql Intellisense to Sql Server Management Studio and Visual Studio.

  • Free 30 day trial, pricing here.
  • Sql Server 2008 has inbuilt intellisense.
  • SqlAssistant is a good alternative for working with multiple database environments.

 

 

Generic Useful Tools

 

Name

Description

Comments

AutoHotKey

Automate sending keystrokes and mouse clicks by creating/recording macros.

 

Bart's Preinstalled Environment (BartPE) bootable windows CD/DVD

Bart's PE Builder helps you build a "BartPE" (Bart Preinstalled Environment) bootable Windows CD-Rom or DVD from the original Windows XP or Windows Server 2003 installation/setup CD, very suitable for PC maintenance tasks.

 

Daemon Tools

To use virtual drives.

 

Instapaper bookmarklet

Instapaper allows you to easily save urls for later, when you have time, so you don’t just forget about them or skim through them.

 

IrfanView

IrfanView is a very fast, small, compact graphic viewer.

 

KDiff

Compare, Merge files and directories.

 

Notepad++

Notepad++ is a free source code editor and Notepad replacement that supports several languages.

 

Paint.Net

Paint.NET is free image and photo editing software for computers that run Windows.

I use this instead of MS Paint for simple tasks.

Portable Apps

Carry your favorite computer programs along with all of your bookmarks, settings, email and more with you. Use them on any Windows computer. All without leaving any personal data behind.

 

ProcessExplorer

Process Explorer shows you information about which handles and DLLs processes have opened or loaded.

This has replaced my task manager for the last couple of years.

SlickRun

SlickRun is a free floating command line utility for Windows. SlickRun gives you almost instant access to any program or website.

 

Synergy

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It's intended for users with multiple computers on their desk since each system uses its own monitor(s).

 

Videora Converter

Videora Converter is a free video converter that converts video files, YouTube videos, movies and DVD's so you can play them on your video playing device.

 

VLC media player

Multimedia player.

Plays most video formats out of the box.

Winamp music player

Mp3 music player.

This supports global hotkey bindings, so I can use use my keyboard to change track, volume without bringing it in focus.

Windows Live Mesh

Keep files and folders in sync on multiple devices.

 
kick it on DotNetKicks.com
 Wednesday, October 01, 2008
Wednesday, October 01, 2008 7:46:35 PM (Mountain Standard Time, UTC-07:00) ( asp.net | css | utilities )

Most of you might have seen that while working on a Website project, the CSS gets harder to maintain as the site ages. This might be due to new developers coming in to the project, removal of UI elements (but not the corresponding CSS), refactoring and so on. I think it is a good idea to revisit and clean your css every few weeks before it becomes totally unmanageable. In this post, i am going to outline 2 ways to do so
There is a great Firefox plugin called Dust-Me Selectors which can test individual web pages or spider your Website to find unused CSS selectors. As you navigate from page to page in your Website, it maintains a list of unused CSS selectors that you can remove.
If for some reason you cannot use the plugin, or would like to be more sure, I have also created a small utility (for personal use) that can parse a CSS file to create a list of defined classes and go through the code base to determine which of those classes are actually being used. This utility usually gives me a list of unused CSS classes with an accuracy of greater than 95%. It cannot give a 100% accurate output in cases where the css classes are being assigned dynamically in JavaScript or server side code (it catches some of them, but not all). But it gives you a great starting point. I normally search my codebase for the CSS class name before commenting it out from the CSS file to be sure its not being used in the code anywhere. I delete the commented out CSS classes after a couple of releases if I do not see any issues.
You can download the utility (named CssCleaner) from here. Please remember that this does not come with any kind of warranty, I am just sharing this so that it can be helpful to somebody in a situation similar to mine.
CssCleaner is pretty simple to use. Download the app, unzip it to a folder on your system. You should see 2 files - CssCleaner.exe and CssCleaner.exe.config. The config file is needed by the application and is present to make a couple of things configurable. I'll talk more about it in a second.


After you run the application, click on "Choose Application Folder" and choose the code base folder for your Website. Click on "Choose CSS File" and select the CSS file that you want to analyze. Change the File Filter if you would like to process files different from the default types. Leaving that textbox blank processes all files. Click on "Process" to run the utility. The unused classes get loaded on the right hand side. In my use, the tool has been pretty fast.
If anybody is interested in the implementation, i use a parser/scanner to parse the CSS file similar to this. Then I go through all the files in the code base, building a list of  used CSS classes using a regular expression. The regular expression is picked up from the config file, so you can tweak it as you find suitable. The other thing picked up from the config file is the list of default file types to search for. It then compares the used CSS class list against the available CSS classes and displays the unused classes list.
If you have any suggestions for the tool, or find any bugs, please leave a comment or email me (latish.sehgal at gmail dot com) and I'll try my best to implement it. I hope that you find this tool helpful.

kick it on DotNetKicks.com