Today was a day dedicated to Virtual PC 2004. My colleague (infact classmate) Ankur was the first one to have installed Virtual PC 2004 and have it up and running. His setup was quite surprising. He was able to install Virtual PC 2004 on a Windows XP Home edition. His one and only GUEST machine was Windows Server 2003. Infact, Virtual PC 2004 does not officially support this setup. Ankur's need was quite different than mine. Since he had a laptop and a desktop computer he could afford for that kind of setup wherein he would be using the Windows Server 2003 for SQL Server 2000 and Source Control. Since I don't have the comfort of having a separate physical server, I wanted to install Windows Server 2003 as my GUEST machine with the HOST being a Windows XP Professional. The idea was to create a Virtual Network with the HOST and GUEST being the only nodes in the network. The excellent help provided by Virtual PC 2004 was useful only to get started. I had to first install the new network adapter(Microsoft Loopback Adapter) using Add Hardware Wizard on my HOST machine and provide the HOST with a static IP address ( for the connection associated with LoopBack Adapter. The similar proceedure was followed in my GUEST machine with the IP address being I also changed the number of network adapters for the GUEST machine in the Virtual PC Console to include the Microsoft Loopback Adapter. I restarted my GUEST machine and expected my HOST to detect the GUEST. That looked like a distant future for me. Basically I could not get it to work. On googling, I found a link to a Virtual PC guy's blog which explains a subtle problem. A chicken and egg kind of problem is what he says. Oh...and here is the actual Virtual PC guy's blog. Now then I had to realize it will take quite more strain to make this thing work or conclude that it will NOT work. At this point I give up for the day and go to reality by taking a nap and iterating on this stuff tomorrow........ LINKS:
  1. A-Z on Virtual PC
  2. Virtual Server
  3. TechNet Virtual Server Technical Briefing in Edinburgh

Finally I got a chance to use these tools (NAnt and NUnit) The first to be used was NUnit 2.2 and had problems using it because I don't have permissions to install any assemblies into the .NET 1.1 Global Assembly Cache. So, I had to obtain the source and did the manual installation of copying all the required assemblies into a single folder. Then I set up the Path Environment variable to include path where these assemblies were put. After doing this I went cruising my way creating cool unit tests for my own library under construction. It all worked fine and I used the NUnit-GUI to test my applications. Then came the second half of the fun! I had to now use the NAnt build tool. So, went ahead and downloaded the binaries for NAnt. As done earlier, set up the environment variable path. I was lazy and tried to use the build of my VS.NET projects using the task. Boom! A enormous list of errors and exception finally thrown at me by the NAnt utility. Now, I did not want to use the task and went ahead to create my own directory structure (deciding where each output should go into and also keeping in mind the NUnit tests to be run automatically by NAnt) and corresponding task in my build.xml file. The most frustrating or shameful mistake I did was to forget the fact that xml tagging is case sensitive. So, all I was getting was errors reporting FileNotFound. Spent nearly 2 hours in wain untill I was forced to get reminded of this fact that xml tagging is case sensitive! And that is not the end of it! When tried to use the task got the exception that NAnt could not find the nunit.framework.dll assembly (as expected, because i have not installed the NUnit assemblies into the GAC and that is because I DON'T HAVE PERMISSIONS). Then I went on with the task to execute the “nunit-console.exe”. Now the whole fun started :) Again the problem of nunit.core and nunit.framework assemblies not found problem. The problem was that I did not bother about nunit.core and nunit.framework assemblies when using the nunit-gui because they were in the same folder as that of nunit-gui.exe. But, now when I run nunit-console, the present working directory will be the location where the build file is present and thus nunit-console cannot find the nunit.core and nunit.framework assemblies. So, the only solution left for me was to copy the nunit.core and nunit.framework assemblies from the installed folder (the path is hard coded in the build file; I do not like to do that) to the present working directory. That solved the main problem. But I really failed in transforming the TestResult.xml produced automatically by NUnit-console to a proper html output using the “Summary.xslt”. Too much to handle for a single day may be.. So I am giving up on that and am contended with the error output files. The immediate task facing me now is to use the al.exe for linking the modules just compiled using NAnt's build process into a single assembly and placing in the GAC. But hold on, I do not have permissions to install an assembly into the GAC! Instead, I have the SSCLI's GAC. hmmm, that would take more time I guess. I just wish some kind of USER Specific GAC is provided in .NET! (or may be permissions can be granted to install the assemblies generated and strongly named by the CURRENT USER into the GAC). Got to look into .NET Operation documentation for all these stuff! Ok. Now time to shift to Rotor and leave .NET for a while! Phew!

I have now originally copied an idea from Rick. The idea is on how to make myself read a book. Rick started by writing out snippets (in his own words) from a book he was reading. Not just writing it for himself, he was sending them as mails to the collegues. It so happened that for sometime such mails stopped which prompted me to mail him to ask about the proceedings. He said he shall continue doing it. Which makes him read the book. I have also started to do something like that now. I am reading the “Essential .NET - The CLR” by Don Box. And not just that. In our internal forum, a new forum has been dedicated to this purpose. (email becomes cumbersome due to maintainance problems). Advantages:
  • I get to read the book as collegues expect something every day.
  • I also get to summarize what I have read (best method to retain knowledge is to share it).
  • Collegues also get to read the book at a glance.
got to code now.....

Today, I had to create the skeleton VS.NET solution along with the different .NET projects that would go into the solution for a new project at my workplace.

The reason I chose today as the day for this is that I could see someone starting to go ahead with the project development like some student hacking his way around. I have lost the patience to even look at such kind of coding. Worst is the case when there are files named “WebForm1.aspx” and “WebApplication1.sln”. If not today then never it will be. If substantial amount of coding goes into the project then the natural tendency to resist change occurs and the result is spaghetti code. ( ”Denial is the most predictable of all human responses” - from Matrix - http://www.neoandtrinity.net/)

In my previous ASP.NET web application project, majority of the time was spent on setting up the environment and learning new stuff.( VSS to CVS transition, 3-Tier Architecture, User Interface Process, Authoring Web Pages, Web Menu, User Controls, Authentication & Authorization, Coding Guidelines, Javascript and Asp.Net co-existence, DataGrids, Session Expiration, Understanding Struts to understand MVC, Deployment etc...). In fact, every damn thing was new. Not much time was devoted on implementing most of the suggestions in “Real-world tips for Real-world web application” web-cast by Paul D. Sheriff, President, PDSA Inc. Almost all the tips are right on target and gives the viewer enormous confidence and courage to immediatly try including them in their current project. And quite a few of the tips were incorporated. I was scared to experiment more due to the UIP application block being used (which in itself is mind-bogling stuff).

This project will not use the UIPAB and hence the decision to start with business logic coding only when all the real-world tips are included. At this precise moment, I've included 6 of 10 tips in this project (The coding for which started about 9 hours back). A more elaborate webcast on N-Tier programming (”Designing LOB applications using Asp.NET”) was refered and hence a different project folder structure has been adopted.
  • N-Tier programming (done)
  • Application Settings (done)
  • User Interface
  • Base Page Class (done)
  • Track Users (next in the task queue)
  • Exception Management (done)
  • Session Variable Usage (done)
  • Manage Unhandled Exceptions (done)
  • Security (doing...)
  • Performance

Now, let me come to the relation of this post with that of its subject. The code sample provided and refered by Paul D. Sheriff was written using VB.NET and the project I am developing is using C#. So, most of the time I had to replicate the code in C# for which I had to understand VB.NET code also. This process of looking at a code written in another .NET language and writting the same functionality in another .NET language is very fascinating. Some of the syntax I used to take for granted were made to understand.

Now, one might argue that this can be done with other languages also. Advantage in this case is that both VB.NET and C# uses the underlying FCL and thus makes it very easy to do the conversion and hence the learning. Imaging doing the same from Java to C# (I guess this might also be easy owing to the fact that many OSS existing in Java are now being written in C#).
I've now decided that to understand any code, best method is to re-write the code using some other language. I think VB.NET developers will get a better grip on Object-Oriented languages by using this technique.

Also, for the first time I have thought about the number of lines of coding that has gone in today. Stumbled upon the “devMetrics” tool for C# code analysis and reporting. Unfortunately, It is not enabling the Analyze... option from the VS.NET 2003 IDE. But, I could generate the report using the Command Line facility and found that the amout of code written today by me is approx. 250 lines.

Ok... Time to take a nap and go home in the morning....

It makes me awe at the pace with which Microsoft is introducing new products. Added to that list is Microsoft VS Team System. Just the kind of product we wanted.

Got to appreciate the way this product was released. No clue about it till the last minute of announcement. Being a avid reader of the blogs, not many gave any clue about such a product. (or, have there been news about it? Not to my knowledge!)

While the attention was diverted in the blogs about new features in existing products (Office and Whidbey) or about features in some distant product (Longhorn), a silent product was under development with tight lips.

Now, is Microsoft creating a pattern for the usage of blogs. “Use blogs mostly for gaining/providing insights into distant/existing products”

This becomes evident as a blog being created immediately for VS Team System!
Any case, good going!

Lots of stuff ahead in 2005.