I have a series of libraries I wrote 5 years ago which handles conversion of daylight savings to and from any time zone world wide.  We use this in our application, Project Insight (http://www.projectinsight.net) and in other projects that we do that deal with dates and times.  

So after spending an entire weekend putting the library together in .NET 1.0 (and all future versions too) I was keenly interested when Congress changed the US daylight savings rules on us.  As soon as it was official I updated my library and didn’t think anything of it after that knowing my libraries did the rules correctly.  I assumed that Windows update would update all our OS’s long before this became a problem.  Boy was that assumption way off base!  I just discovered that hardly any computer in our network has the update for the new daylight savings rules!  Yikes!

To find this out I did some diagnostic tests (see “My Original Diagnostic Test” results below!).  I was disturbed with the results.  My computer did not do the conversion correctly.  I moved my app to other computers and found that they too did not do the conversion correctly!  I did some searches on the web to see if other people had this problem and did not find much about .NET and this problem.

Finally, I did find a KB article from Microsoft that was first posted on 11/21/2006 that deals with this.  It was last updated 2 days ago (1/22/2007).  To me I’m quite alarmed that this updated didn’t make it out until 11/21/2006??!!??  There are probably millions of computers, desktops, servers etc out there in the US that will be converting time incorrectly in Outlook and other applications come 3/11/2007!  I can see it now, a mini Y2K problem is potentially brewing here with totally screwed up dates and times nationwide for the 3 weeks or so before the first weekend in April!

I hope not!

If you want the update you can get it here!

http://support.microsoft.com/kb/928388

other daylight info:

http://www.microsoft.com/windows/timezone/dst2007.mspx 


Also I have built a simple app which you I can send to you (I can’t figure out how to post a download on WordPress I don’t think they allow it) to test whether or not your computer has the update for the daylight rules. The app simply tests the time portion of two dates before and after the conversion takes place to see if you get the same time portions of the two when converted to UTC.   If the times are equal, well you don’t have the update because the offset is the same meaning daylight did not take affect according to your system.  If the time portions are not equal, then you’re lucky and you already have the update! 

My Original Diagnostic Test 

I built a simple windows APP that will takes a date and converts it into UTC using the DateTime.ToUniversalTime() method.

Old Daylight Rules (2006 and Before)
Daylight savings in the US springs forward one hour at 2:00 AM on the first Sunday of April.

New Daylight Rules (2007 and After)
Daylight savings in the US springs forward one hour at 2:00 AM on the second Sunday of April.

I have a simple windows APP that takes the date you pick plus your current local time and calls the following code:

DateTime date = this.dateTimePicker1.Value;

MessageBox.Show(date.ToUniversalTime().ToString()); 

System In PST with Daylight On As of 1/24/2007 OLD RULES – I GET THIS

3/10/2006 8:55 PM PST converts to 3/11/2006 4:55 AM (before Second Sunday of March)

3/13/2006 8:55 PM PST converts to 3/14/2006 4:55 AM (after Second Sunday of March)

4/1/2006 8:55 PM PST converts to 4/2/2006 4:55 AM (before the first Sunday of April)

4/3/2006 8:55 PM PDT converts to 4/4/2006 3:55 AM (after the first Sunday of April)

These appear to be correct under the old rules.

NEW RULES – I GET THIS 3/9/2007 8:55 PM PST converts to 3/10/2007 4:55 AM (before second Sunday of March)

3/12/2007 8:55 PM PDT converts to 3/13/2007 4:55 AM (after second Sunday of March)

THIS IS INCORRECT!


I expect this: 3/12/2007 8:55 PM PDT converting to 3/13/2007 3:55 AM (after second Sunday of March) 
To continue the test:3/31/2007 8:55 PM PDT converts to 4/1/2007 4:55 AM (before first Sunday of April)THIS IS INCORRECT! I expect this: 3/31/2007 8:55 PM PDT converts to 4/1/2007 3:55 AM (before first Sunday of April) 

To continue the test:

4/2/2007 8:55 PM PDT converts to 4/3/2007 3:55 AM (after first Sunday of April)

THIS IS CORRECT! 

Earlier I posted an article about the new web site model in Visual Studio .NET 2005.  At any rate it appears as though Microsoft is making strides toward introducing the Web Application model into VS 2005, which allows a single assembly and behavior similar to VS.NET 2003.  The new model is far superior to the web site model for serious applications since the web site model appears to have the intention of making web site development projects easier to do.  The only trouble with this is that it seriously hampers your ability to use inheritence in a significant way.

 With Project Insight (http://www.projectinsight.net) we setup our SDK in such a way that the Web Application project is required.  When we deliver our product the web application code behind is delivered in a single dll and the web forms are left uncompiled.  The new web site model in VS 2003 would not have supported this very well.  With that dll, we allow our SDK customers to actually use the assembly as a reference and override our classes to implement their own classes.   This allows the SDK developers to easily modify our existing forms and/or create new forms using our base page classes.   All of the header and footer controls are managed in the base classes so that the interface is automatically rendered and handled.  The new web site model would not have allowed this.

 Another really important feature of the web application model is that within the web project itself, you can now create user controls and other controls and create base page classes that implement functionality based on those controls.  If the developer adds those controls to their page the base class can manage and handle them.  Again the web site project would not handle this, but the web application project would.

For more information on the Web Application Project visit Scott Gu’s blog about it:

 http://webproject.scottgu.com/

Don’t pull your hair out with this running ASP.Net 1.1 and ASP.Net 2.0.  Apparently you cannot run ASP.Net 2.0 in 64 bit mode and run ASP.Net 1.1 in 32 bit mode at the same time with IIS 6.0.

 Here is some information from MS that I encountered that helped us to get ASP.Net 1.1 to work on x64:

From Microsoft Support:

IIS 6.0 supports both the 32-bit mode and the 64-bit mode. However IIS 6.0 does not support running both modes at the same time on a 64-bit version of Windows. ASP.NET 1.1 runs only in 32-bit mode. ASP.NET 2.0 runs in 32-bit mode or in 64-bit mode. Therefore, if you want to run ASP.NET 1.1 and ASP.NET 2.0 at the same time, you must run IIS in 32-bit mode

After you install the redistributable packages, you can switch between the different versions of ASP.NET. To do this, follow these steps for each ASP.NET version:

ASP.NET 1.1, 32-bit version
To run the 32-bit version of ASP.NET 1.1, follow these steps:

1. Click Start, click Run, type cmd, and then click OK.
2. Type the following command to enable the 32-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
3. Type the following command to install the version of ASP.NET 1.1 and to install the script maps at the IIS root and under:
%SYSTEMROOT%\Microsoft.NET\Framework\v1.1.4322\aspnet_regiis.exe -i 
4. Make sure that the status of ASP.NET version 1.1.4322 is set to Allowed in the Web service extension list in Internet Information Services Manager.

ASP.NET 2.0, 32-bit version
To run the 32-bit version of ASP.NET 2.0, follow these steps:

1. Click Start, click Run, type cmd, and then click OK.
2. Type the following command to enable the 32-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
3. Type the following command to install the version of ASP.NET 2.0 (32-bit) and to install the script maps at the IIS root and under:
%SYSTEMROOT%\Microsoft.NET\Framework\v2.0.40607\aspnet_regiis.exe -i -wow64 
4. Make sure that the status of ASP.NET version 2.0.40607 (32-bit) is set to Allowed in the Web service extension list in Internet Information Services Manager.

ASP.NET 2.0, 64-bit version
To run the 64-bit version of ASP.NET 2.0, follow these steps:

1. Click Start, click Run, type cmd, and then click OK.
2. Type the following command to disable the 32-bit mode:
cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
3. Type the following command to install the version of ASP.NET 2.0 and to install the script maps at the IIS root and under:
%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.40607\aspnet_regiis.exe -i 
4. Make sure that the status of ASP.NET version 2.0.40607 is set to Allowed in the Web service extension list in Internet Information Services Manager.
Note The build version of ASP.NET 2.0 may differ depending on what the currently released build version is. These steps are for build version 2.0.40607.

 How to switch between the 32-bit versions of ASP.NET 1.1 and the 64-bit version of ASP.NET 2.0 on a 64-bit version of Windows

ASP.Net 2.0 is a great advance in many ways, particularly the partial classes which will help cut down on the amount of time required to build a new form since you won’t have to declare everything on the back page.  There is one area that has become somewhat of a hot topic for those building more advanced web applications.  What is at issue appears to be the new inheritance model of ASP.Net, which was changed in order to make ASP.Net easier to use for less experienced developers.  The inheritance model in ASP.Net 2.0 does not allow classes (code behind) from user controls or web forms to be shared inside the application.   Additionally all code that is not directly tied to a form or user control is by design supposed to reside in a new fixed folder called “App_Code”. 

 For an example, imagine that you created a base class for all of your pages to inherit from, you would need to place that class in the “App_Code” folder.  Once you place that base class in the “App_Code” folder you cannot access any of the forms or user controls outside the “App_Code” folder.  So let’s say you have a user control called “HeaderTemplate” and you had a base class that your pages inherited from called “DefaultTemplate.”  The “DefaultTemplate” resides in the “App_Code” folder and the “HeaderTemplate” resides in the main ASP.Net structure.  The “DefaultTemplate” cannot access or declare the “HeaderTemplate” control because the “App_Code” folder is essentially treated like a separate class library.  The ASP.Net application can see the “App_Code” folder, like it was a depedency, but the “App_Code” folder cannot see the ASP.Net application. 

In ASP.Net 1.x the application structure was much less rigid and more flexible and allowed for greater control over how classes inherited from one another and the interoperability of these classes was powerful.  There are several articles that I have found pertaining to this discussion here is one that really explains in great detail the information above Understanding Page Inheritance in 2.0 by Rick Strahl.

Interestingly, I have also come across another article which shows that a solution from Microsoft may be on the way.  Apparently so many of us have complained about the change that Microsoft is introducing a new project type tenantatively called “Web Project” which will give the benefiits of the partial classes with a more flexible ASP.Net 1.x approach.  I am hopeful that the new model will solve the inheritance problem that I describe above.  For updates on the “Web Project” model view Scott Guthrie’s article: New Web Project Model Option Coming for VS 2005

 

Welcome to the ASP.Net, Web-Based Project Management Software Development resource.  Where should I begin?  I’ve been developing web-based technology since 1995, starting with the old CGI/Perl route in the early days.  Around 1997/98 I decided that it would be best to go the ASP VB route, which worked well.  As soon as .NET came out I jumped full speed into it and switched to C# as my desired language.  I am also the lead developer of Project Insight (http://www.projectinsight.net) and have spent a large amount of time developing, and working with our development staff on the project.  I have decided to setup this blog to share my ideas, thoughts and experiences about ASP.Net. 

Over the next week I will be posting some discussions about some of my thoughts and/or experiences with ASP.Net.  Also I will share some ideas and thoughts I’ve had regarding my experience with developing some very advanced Project Management Software.  

Welcome to the blog!