Sunday, May 17, 2009
Now that IE8 has become an important download from Microsoft, I expect to see the asp:menu bug raising its head more frequently. Mostly the asp.Net controls seem to work well in IE8. Unfortunately there is a bug in the menu control that is highlighted when using a standards compliant browser (like IE8, but interestingly Firefox does not comply with this particular standard).
The symptom is that the dynamic portion of an asp:menu is rendered entirely in white (i.e. unreadable) in IE8. There are several solutions:
- View the site in compatibility mode
- Download the hotfix from Microsoft
- Use a CSS adapter for your controls
- Add a z-order to the CSS for your dynamic menu
- Add a meta tag to the web site
Personally, I went for the z-order solution as it was the quickest to implement (am I not Agile?). To implement this, change the CSS class of your Dynamic menu. I do this using the DynamicMenuStyle-CssClass attribute of the asp:menu control.
e.g.
<asp:Menu ID="Menu1" runat="server" DataSourceID="StdSiteMapDataSource" Orientation="Horizontal"
StaticMenuStyle-CssClass="StaticMenu" StaticMenuItemStyle-CssClass="StaticMenuItem"
DynamicMenuItemStyle-CssClass="DynamicMenuItem" DynamicMenuStyle-CssClass="DynamicMenu"
StaticHoverStyle-CssClass="StaticMenuHover" StaticSelectedStyle-CssClass="StaticMenuSelected"
OnMenuItemDataBound="Menu1_MenuItemDataBound" StaticEnableDefaultPopOutImage="False">
<StaticMenuItemStyle ItemSpacing="0" />
</asp:Menu>
In my CSS file I have this:
.DynamicMenu
{
background-color: #3e6fc8;
margin-top: 1px;
z-index: 100; /* IE 8 menu fix */
}
Check this blog entry out for some futher information about this.
After my debacle a couple of days ago removing my RAID array, I was thinking about how undramatic the shift to 64 bit has been for me.
I moved my server and principle development PC to 64 bit over the last few weeks. For the server I bought a completely new machine and installed 64 bit from scratch. My server and desktop are similar specs, both having quad core processors with 4Gb RAM (I'm thinking about upgrading the RAM further...)
In general, the move to 64 bit has been pretty simple. Almost everything I have installed works without problems. My desktop PC feels faster now and certainly gets to the Windows login screen much faster than it used to. It is tricky to specifically attribute that to the 64 bit move as I completely reinstalled Windows which always makes things move a bit faster! However, weeks (and several program installations) later, things are still moving along pretty quickly. I even installed Elder Scrolls Morrowind which runs without a hitch on a 64 bit platform!
My only real problem as been IIS 7 on a 64 bit platform. On the server I struggled to get Outlook Web Access working (and any other web site). I had to do a bit of Googling, but I eventually found out how to configure the server to permit 32 and 64 web sites to run side by side.
So overall, I would recommend looking at 64 computing for developers (and Morrowind fans).
Friday, May 15, 2009
I have been having some problems with my RAID 5 array on my desktop. Every couple of weeks I turn the PC on in the morning and it decides that it needs to rebuild itself. This takes 8 or 9 hours and leaves the PC all but unusable duiring this time. Since a RAID array is supposed to help me out rather than hinder me, I decided it was time for it to go.
I am running Vista Ultimate 64 bit (which is much faster than the 32 bit version). I decided to the the Complete PC Backup utility to back up the computer and then I would restore it. I had 4 160Gb disks in the RAID array and four drive letters striped across all four disks (c, d, e, f). I intended to create a backup image and then restore the drive letters to individual disks rather than use a RAID array.
Oh bugger. As it turns out, the Complete PC Restore utility will only let you restore to the same number of volumes that you backed up from (i.e. 1). Sigh... This was a problem because my data was larger than 160Gb. Luckily, I had a 1Tb disk lying around, so I swapped out one of the old 160Gb disks and put in the new 1Tb disk. Happy days! Nearly... This next bit will save you a sleepless night one day!!!!
As soon as the restore started I got an error message "Element Not Found 0x80070490". This is not the most helpful error message I have ever seen. I did some Googling (in a panic I must admit) and discovered a strange quirk of the restore utility. For it to work, you must do 2 things:
- Ensure that the boot order in your BIOS is CD-ROM followed by the disk you are restoring to
- Do not connect the USB hard disc you are restoring from until just before the restore utility scans the available disks for backups
Always check your boot order before a restore. You are likely to have changed hard discs if you are doing a restore which means the boot order in your BIOS is likely to have changed too.
What a crazy world we live in...
Sunday, May 10, 2009
A buddy of mine Geoff Watts has been involved in Scrum for many years
(I actually did my Certified Scrum Master course with him). He is
organising a couple of events that will be of interest to our
community.
First off, he is organising an event for the London Scrum User Group
at which Ken Schwaber and Jim Cundiff will be speaking. This will be a
great event as they are both lively speakers!
Additionally he has two Scrum courses coming up on 8th and 9th June
and 13th and 14th July. Geoff is a great teacher and I would recommend
these to anyone who is thinking of doing the Certified Scrum Master
course. In particular, Ken Schwaber will be at the second course on
13th / 14th July which will be a great opportunity to question the man
himself! I'm sure you can get a good price if you mention my name!
You can get more details on Geoff's site at www.inspectandadapt.com.
Wednesday, May 06, 2009
In this session, Ralph will provide an overview of some techniques that
bring Agility into the world of testing. (The world of testing is a strange
place: regarded by most people as a nice place to visit but you wouldn't
want to live there, it is an unmapped wilderness where the waterfall
methodology still roams unfettered.)
The main focus will be on one such technique, Exploratory Testing. It is
defined by many as "simultaneous learning, test design and test execution",
but Ralph will attempt to be more helpful. After the presentation many of
you will claim this is what you have been doing all along, but now it has a
fancy name you can use it without shame and companies can sell you
high-priced consultancy in it.
SpeakerRalph Williams is a Test Consultant at the Yorkshire Building
Society, based in Bradford. The Society develops much of the application
software used throughout its 140 branches and offices, and Ralph is
responsible for managing the testing for some of these systems. He has
previously worked in various management, testing and development roles at
Erudine, Wanadoo and British Telecom, and specialises in Agile Testing and
chocolate.
Venue: Victoria Hotel, Central Leeds
Date/Time: Wednesday, 13th May, 6.30pm for a 7.00pm start.
More details: http://www.agileyorkshire.org/
Anyone welcome.
Thursday, April 30, 2009
Over the years I have used SourceSafe, CVS, Subversion and some Borland thing I can't remember the name of (I've bloack it out as a traumatic experience). This week I have been working with a new developer and I have been trying to share my Source code with them. Since I've been working on Solo Agile projects recently I have been using SourceSafe 2005. I have always find it to be fast and stable and I have never had any problems with it.
The challenge was then to get the SourceSafe 2005 database visible over the Internet. Out first attempt was to use SourceOffSite from SourceGear. We quickly excluded this option as the technical requirements show that it is not compatible with Windows Server 2008 64 bit edition.
We also tried to get a VPN working on Windows Server 2008 using SSTP, but failed. It may have to do with the mobile network we were using to try to connect. We struggled to get this to work and we could not get a sensible error message out of either server or client!
So we moved on to the SourceSafe 2005 HTTP extension. We spent a couple of hours trying to get this to work and ultimately failed. For no explicable reason we could not get the SourceSafe web service to work. By this point we were tearing our hair out!
So we turned to our third option which was migrating the source code to a different system. Jon suggested that we look at VisualSVN. I have avoided Subversion recently as I have primarily been an ASP.Net developer. The last time I used Subversion, it was not possible to connect the HTTP interface via IIS. However, VisualSVN contains client and server components which address this. The server portion contains an HTTP server which solves my problem.
It took about ten minutes to set up and install the server software and Visual Studio client software. It took another 10 minutes to clean up the SourceSafe source code repository and get it into Subversion. The whole thing worked over the Internet via SSL with no drama at all!
So, my recommendation for you guys out there in a similar situation is to take a good look at Visual SVN!
Sunday, April 19, 2009
One of my ASP.Net apps uses Jet 4.0 to read and write to Excel files (for importing and exporting data to and from the app). After a rebuild on my Windows Vista 64 bit development machine, I had the following error when executing some tests:
- The 'Microsoft.Jet.OLEDB.4.0' provider is not registered on the local machine.
After a few minutes on Google, I found that this error is due to a lack of a 64 bit version of Jet 4! However, this should not be a problem as I can configure my app to build in x86 mode rather than 64 bit mode. A quick rebuild later my tests are all passing! Success! erm... Not quite...
Under IIS 7 I then got this error trying to access the web app:
- An attempt was made to load a program with an incorrect format.
Again, Google came to the rescue with some information about running 32 bit web apps under a 64 bit install of IIS! Have a look at the Microsoft article here:
The good stuff is about half way down the page under the heading "ASP.NET 2.0, 32-bit version". After entering the two suggested lines at the command prompt my 32 bit web app is now working on my 64 machine. Fantastic!
Due to a catastrophic error on my PC, I recently reinstalled Windows and went for Vista 64. It seems a little more responsive than the 32 bit version, but that could be just because it has less garbage on it than before...
After resintalling all my dev stuff (VS 2008, SQL 2008, TestDriven.Net, MbUnit, Telerik controls etc) I found that my MbUnit tests would not run via TestDriven.Net. I found the solution (via Google) within a few minutes. If Dave Bouwman had not bothered to blog his solution, I would have spent hours smacking my head against the wall, so thank you Dave!
------ Test started: Assembly: TileServer.Core.Tests.dll ------
The target type doesn't contain tests from a known test framework or a 'Main' method.
If you see this error after installing Vista64, it is because if an error installing some registry keys. Check out Dave's blog for the solution:
Saturday, April 18, 2009
I've just got back from the fantastic Alt.Net conference which was held at the offices of Black Marble in Bradford, West Yorkshire. The entire day was very well organised by Richard Fennell. There were lots of different topics on the agenda including:
- Microsoft MVC
- Silverlight
- Agile Project Mangement
- Inversion Of Control
- Domain Specific Languages and Fluent Interfaces
- What Happened To Design?
- Which ORM?
- Azure and The Cloud
I started the day looking for inspiration and I certainly found it! Whenever I attend conferences I am not looking for detailed information on a topic, I am predominantly looking for new ideas and directions I had not thought of.
The things I learned about that I am going to tke further are:
- Azure
- Inversion Of Control
- Domain Specific Languages and Fluent Interfaces
- Microsoft MVC
The discussions were all lively, but courteous and respectful, even when the contentious issue of Which ORM was discussed!
Anyone wishing to follow up on any of the issues raised at Alt.Net are welcome to contact me or come along to
Agile Yorkshire and find out more!
Sunday, April 05, 2009
For the last couple of years I have been zealous in my TDD discipline. By zealous I mean that when I write "public" on a method, I write a test. I was fortunate enough to attend a session on Testing Patterns (see previous blog entry). I had a question for the speaker about how he would handle testing a particular simple method. In this case the method was something like AddNewJob(xxx). To my suprise the recommendation was that I should not bother unit testing it as it was too simple and I should leave it up to the testers to cover it off in their testing activities!
This was a real eye-opener for me, so now I am in a bit of a quandry. Lots of the code I right for mid-range applications is very similar to this method. The AddNewJob(xxx) method inserts data into a few related tables. My tests have historically queried the SQL tables to ensure that the insert was completed correctly. I had noticed a significant reduction in error rates following this approach.
As an experiment, I have recently ( a few weeks ago) stopped writing unit tests for all "public" methods and I am just writing tests for more complex methods. I have made a few observations as a result of this experiment:
- I don't think my error rate has gone up
- I do not believe that my coding speed has improved
- I am writing almost no tests (most of my code is very simple - which is a good thing I suppose)
- I don't feel virtuous any more
In the short-term then, I seem to have retained the benefits of TDD even though I am not doing it as much! I suspect in the long term that my "untested" code will suffer a little as I do not have automated tests around it. I think that this means I will not spot side-effects of code changes as early as I will on tested code.
I suspect that my retention of quality is a direct result of the extra coding discipline that TDD has instilled in me. I find my self being much more careful about parameter checking etc these days. I think that the longer I go without writing tests, the more lax I will become in my coding and my error rate will begin to creep up again.
So, the result of my experiment is pretty inconclusive (largely because I have not formally collected data) and I think I will retain to my more zealous approach, if for no other reason than it makes me feel more confident and more virtuous about my code!