When I recently purchased a Macbook Pro, I had a couple of options to set up my .Net development environment on there. I could use a Virtual Machine based solution such as Parallels or VMware Fusion, or run Windows natively using BootCamp. My first preference was to stay inside the Mac OS if possible. I spent some time researching which product other developers are having more success with and Fusion seemed to be more stable and responsive for the majority of them. I downloaded the trial version from their website and took it for a spin, and have been really happy with it.
I have used both XP and Windows 7 in a VM with Fusion, and the performance has been pretty flawless. I allocate both processors, 40 GB of hard disk space and 2 GB of RAM to a VM. Some of my peers have long been advocating the advantages of developing using VMs, and now I totally get how cool this way of working is. I can create and restore snapshots at any point of time, create a new VM to try out any beta software, and keep my development environment isolated from softwares/utilities that it does not need (avoiding software bloat). I am using a Windows 7 VM right now for the most part and playing around with Visual Studio 2010 on it. I intially found the Unity feature in Fusion (it gives the illusion of running Windows apps natively on the Mac OS) to be really cool, but I don't really use it much. I have dedicated a Space to my VMs, and tend to work in full screen mode.
If you end up going the same way as me, I would recommend looking at multiple vendors before purchasing Fusion. I bought if off Amazon, and it cost me $23.49 (including a $10 mail-in rebate). Other sites,including VMware, offer it for upto $80.
At the C# SIG meeting in Dallas last week, David mentioned something really interesting about using a productivity add-on such as ReSharper or CodeRush. I think his exact quote was:
“If your not using a productivity tool, you’re ripping off your customers and wasting your time”
While I have met and worked with many ReSharper/CodeRush users in the past and talked about the value that such tools add, the sentiment has never been so strongly expressed. I have been playing around with both the tools over the last several months and am a happy ReSharper user now. I found CodeRush to have a lighter memory footprint, but the graphics and effects just got in the way of my work. ReSharper, on the other hand, was very usable and intuitive and had a minimal learning curve. Your experience might vary, but I would encourage you to take both the tools for a spin and try using one, if you are not already doing so.
Coming back to David’s statement, I think I agree with him more or less. Not only can you save some serious time by using such a tool, these add-ons generally encourage you to write cleaner code. You also deliver more value to the client in less time, and that could possibly lead to better feedback, more projects or recommendations to other clients.
I just came back from the Big Design Conference held today in Dallas, and my brain is just flooded right now with all the information I picked up on different design and development topics. It was one of the most well organized conferences I have been to, with 4 parallel tracks (Social Media, Code Development, User Experience and Strategy) going on throughout the day. The hardest part was to pick a session out of the different choices to go to. I ended up attending Chris Koenig’s session on touch based apps, Stephen Anderson’s talk on seductive interactions, Caleb Jenkins’ Silverlight 3 talk and Todd Wilken’s session on saying No and learning. All sessions had great content and I even got to play with a Microsoft Surface Unit, which was again very impressive but is still very expensive (~$12K-15K) to own a personal unit.
There were lots of Macbooks (designer conference, duh) and netbooks being used in the audience, and the conference twitter stream was buzzing throughout the day with reviews and feedback from the attendees. The conference organizers even had the twitter stream displayed to the public in the hallway.
This just goes on to show the increasing importance of social media like twitter at such events. Overall, it was a great experience and I got to meet some really interesting people in the Dallas area as well as attend great presentations. A big thanks to the organizers for arranging this.
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. | |
Just follow these simple steps ( I am using the Ajaxcontroltoolkit library as an example here)
1. Download Sandcastle (http://www.codeplex.com/Sandcastle).
2. Download and install Sandcastle Help File Builder (http://www.codeplex.com/Wiki/View.aspx?ProjectName=SHFB).
3. Check http://www.ewoodruff.us/shfbdocs/Index.aspx?topic=html/8c0c97d0-c968-4c15-9fe9-e8f3a443c50a.htm for other requirements. If you have Visual Studio installed, you should probably be good.
4. Run SandcastleBuilderGUI.exe, Create a new project and save it in the same location as your solution file. You can add it to the solution for easier version control maintenance.
5. Add your main assemblies to be documented using the Add button. Make sure your Visual studio project for that assembly is set up to generate xml documentation file (Project->Properties->Build->XML Documentation file should be checked).
6. In Project Properties within Sandcastle Help File Builder
a. Under Build -> Dependencies, Add the folder containing all the referenced assemblies, or add them individually.
b. Select the correct version under Build ->FrameworkVersion.
c. Under Build -> HelpFileFormat, choose the output type (chm and/or website).
d. Under Help File, you can add things like copyright, header, footer, feedback email address etc.
e. Set visibility for different type of members under Visibility.
7. At this point you can build project within Sandcastle Help File Builder to create help file manually. You can see an example of sample output here.
8. To create the help file from the command prompt, use SandcastleBuilderConsole.exe and pass the path to the help project file as a parameter. E.g.
"C:\Program Files\EWSoftware\Sandcastle Help File Builder\sandcastlebuilderconsole.exe" "C:\utils\libs\ajaxcontroltoolkit_help.shfb".
This can be used in a post-build event to automate the generation of help files.
I was one of the participants last week at the We Are
Microsoft Charity Challenge Weekend here in Dallas. The event was organized
very well by Toi
Wright with support from MS Developer Evangelist Chris
Koening . The idea was to build or enhance a charity's Website (chosen by
MS) within the weekend and give a 5 minute presentation on Sunday about the work
done.
Our team was called 4 Devs, a Designer and a non-profit. The
developers were Reza,
Tuan, Tim and
myself. We were lucky to work with Hillyer, a designer whose input really
improved the look and feel of our work. And finally, the charity we worked for
was The Child Abuse Prevention
Center. Here's a team picture minus Tuan who fell ill on the last day.

(L to R) Hillyer, Chris, Reza, myself and Tim
Our goal was to completely redo the Website to give it a Web 2.0 look and
feel and add some new features such as users and membership roles as well as a
calendar module on the side. The overall task seemed too big to manage within a
weekend, but I think we did pretty OK. Here's
our final output that we demoed at the presentation.
We were pretty much
feature complete on sunday, and had some really cool features going for us
including built in multi-language support and on the fly translation
capabilities using Rick Strahl's awesome Localization Resource Provider.
Even though we didn't grab
a place in the top 3 teams (there were a total of 20), I got to meet some great
people, do some networking, eat great food and load up on caffeine. I also
landed a Visual Studo 2008 Pro license as a door prize, and my teammate Tim
nominated me for a cool "Coding Machine" award for staying up and coding through
Saturday night. We still have some improvements to do on the site, and a lot of
refactoring. We are going keep on working together till our client is happy with
the output and gets all his features. If you get a chance to participate in an
event like this, I highly recommend it. Check out http://givecamp.org/ for more information.
Just wanted to mention that JavaScriptSerializer, which was marked as obsolete in .Net 3.5, seems to be restored back to normal status with SP1. Besides checking in the object browser, the only confirmation I found for this was a comment by Scott Gu on this blog post.
This is good news since JavaScriptSerializer does seem simpler to use and can handle anonymous types as well. Its alternative DataContractJsonSerializer is meant more for use with WCF.
I just came back after attending the developer track at Dallas TechDays. It was a really good session. Zain Naboulsi was the main presenter, and man can this guy talk! He gave a 3 part presentation by himself that spanned to almost 4 hours. Here's a picture I clicked with my cellphone during one of the breaks when he was answering audience queries.
Here's a brief break up of his talk today -
- Sql Server 2008 New Features
- Spatial Data
- Table variables
- MERGE clause
- new DateTime Datatypes
- Entity Framework (not exactly part of Sql Server 2008, but he covered this anyways)
- VSTO
- Improvements in VSTO for VS2008
- Sample Addins for Office 2007 using VSTO
- Silverlight
- Improvements in Silverlight 2.0
- Simple Animations using VS2008 and Blend simultaneously
It was a great interactive session, and everybody was impressed with Zain's breadth of knowledge over the different technologies. Some people did want more coding in the Silverlight session, and he promised to follow up on his blog with that. The Dallas asp.net user group president Toi Wright also mentioned the Microsoft Charity Challenge weekend in January where you get to code for you favorite charity over a weekend (Jan16-18, 2009). I have already registered for that and looking forward to a fun filled weekend.
Also, all attendees today walked off with a free Windows Vista Ultimate, so that's always good :).
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.
As web application developers, we depend on the Session to store data pertaining to the user. It's a common scenario that the user might take a half an hour break to take a phone call or a meal while using the application and come back to find out the site behaving in an unexpected manner because his session would have expired (default value for session timeout is 20 minutes). As a developer, it's a good practice to check a session variable for null value before using it, but you can create a much more user friendly environment by redirecting the user to a web page indicating that his session has timed out. The best way to do this is by creating a user control that you can just drop on your master or content page as desired.
I looked around for such solutions, and I have described below 2 such good implementations that should cover most scenarios.
Implementation 1
You can create a web control similar to what Peter Bromberg has outlined here.
This control checks for the HttpSessionState's IsNewSession property and the presence of the ASP.NET_SessionId cookie to determine if the user session has expired. It redirects the user to a timeout page if the session has expired. All you need to do is drop the control on your page and assign the RedirectURL property to your timeout page. The control works for both synchronous and aynchronous postbacks (for those of you using Asp.Net Ajax), and the only downfall for this method is that there's no way to warn the user that his page is about to timeout.
Implementation 2
If you would like to warn the user before his session actually times out, you can create an Asp.net AJAX friendly control similar to what Travis Collin's solution.
This control pops up a warning to the user some time before his session times out and gives him a chance to save his session. You can configure the UI of the warning and the time for warning and timeout while using the control. The only thing to watch out for here is that the developer has to make sure the session (and form) timeout value are in sync with the one configured on the control. I faced a small issue in this implementation because it was not recognizing asynchronous postbacks as user activity. To fix this, all i had to do was add a client side handler for page load and reset the timeout there as well.
initialize : function()
{
....
Sys.Application.add_load(Function.createDelegate(this, this._handlePageLoaded));
.....
},
_handlePageLoaded: function(sender, e)
{
this._resetTimeout();
},
More Posts
Next page »