My .NET Olai

Console.WriteLine("My experiences surrounding the .NET world in which I've been living since my graduation");


Just Another .NET Blog

MerryMan

Wednesday, October 27, 2004

My first experiments with NUnit and NAnt!

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!

Sunday, October 24, 2004

Back to formal education

Oh...it is a awesome feeling to go back to school to study.

I am now enjoying what I had been waiting for nearly 1 year. I am devoting my full time to books and that too on .NET books which makes me feel good.

But, it is not easy to go back to full time study after working in the industry. The contrast is in the case of university, we tend to be very consious about what we are learning. In the industry the learning process is overall and not in depth. So, learning during working is remembered more than the learning at university. I could realize this during my first week of my classes in The University of Hull where I am in the .NET MSc in Distributed Systems Development course. I came to know about this course through a blog post which i am not managing to trace back. And now, I am just doing the kind of stuff I've wanting to do in the past. Some cool low level compiler stuff upto using xml web services.

I have realized that tackling the university learning like the learning while working has lot more advantages. So, I spend a lot of time in the lab and learn the concepts using the text books. The two indespensible books that I carry with me include the famous jeffrey richter's “Applied Microsoft .NET Framework Programming” and Simon Robinson's “Advanced .NET Programming”. The books I am supposed to read include

This way of learning is quite different from how I used to learn in my B.E course back in Bangalore. It is just recognizing the fact that learning the way I used to learn in the college does no good in work and I should not go back to that again just because I am now in formal education.

And all this fits into the system of education here in UK. Here, more importance is given to learning the theory by practice which is the way I am comfortable.

So currently cruising my way developing the solution for a problem (given as an assessment) using the Test Driven Development (NUnit 2.2)... I've had a head start in Test Driven Approach for developing applications in my previous workplace.