Bug 622524

Summary: Calling TimeZoneInfo.Local throws TimeZoneNotFoundException
Product: [Mono] Mono: Class Libraries Reporter: Santiago Corredoira <santiago>
Component: Sys.CoreAssignee: Mono Bugs <mono-bugs>
Status: NEW --- QA Contact: Mono Bugs <mono-bugs>
Severity: Normal    
Priority: P5 - None CC: info, jeroen
Version: SVN   
Target Milestone: ---   
Hardware: x86   
OS: Windows Vista   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Santiago Corredoira 2010-07-15 09:39:19 UTC
User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618; .NET4.0C; .NET4.0E)

Any call to TimeZoneInfo.Local throws a TimeZoneNotFoundException

Reproducible: Always

Steps to Reproduce:
1. call TimeZoneInfo.Local 

Actual Results:  
Thrown 'System.TimeZoneNotFoundException'.

Expected Results:  
The local TimeZoneInfo

I tested with XSP 2.6.6. This is the simplest test:

<%@ Page Language="C#" %>
<%= TimeZoneInfo.Local == null %>

The result:

System.TimeZoneNotFoundException: Exception of type 'System.TimeZoneNotFoundException' was thrown.  at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0   at ASP.timezoneinfo_aspx.__RenderTree (System.Web.UI.HtmlTextWriter __output, System.Web.UI.Control parameterContainer) [0x00000] in <filename unknown>:0   at System.Web.UI.Control.RenderChildren (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0   at System.Web.UI.Control.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0   at System.Web.UI.Page.Render (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0   at System.Web.UI.Control.RenderControl (System.Web.UI.HtmlTextWriter writer) [0x00000] in <filename unknown>:0   at System.Web.UI.Page.RenderPage () [0x00000] in <filename unknown>:0   at System.Web.UI.Page.InternalProcessRequest () [0x00000] in <filename unknown>:0   at System.Web.UI.Page.ProcessRequest (System.Web.HttpContext context) [0x00000] in <filename unknown>:0
Comment 1 Jeroen Frijters 2010-09-09 04:20:21 UTC
This also affects IKVM.NET
Comment 2 Flurin Rindisbacher 2010-11-27 00:55:25 UTC
I can confirm this on Windows 7 using mono 2.8.1.

the following program fails with different timezones:

using System;

namespace TimeZoneTests
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			Console.WriteLine (TimeZoneInfo.Local); 
		}
	}
}

I tested it with "(UTC -06:00) Central" "+1 Berlin Bern ..." and some other timezones. if I use the mono Runtime in Monodevelop the above program fails. if I use the Microsoft .Net Runtime it works as expected.