I have created a view using Servicestack.Razor. On the view page I am trying to get the session using following code.
var session = GetSession<AuthUserSession>().ToJson();
When I put this code on the view page, I get following error:
System.TimeZoneNotFoundException
Exception of type 'System.TimeZoneNotFoundException' was thrown.
Description: HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): mscorlib.
StackTrace is as below:
Exception stack trace:
at System.TimeZoneInfo.get_Local () [0x00000] in <filename unknown>:0
at ServiceStack.Text.Common.DateTimeSerializer..cctor () [0x00000] in <filename unknown>:0
Is this a bug in Servicestack.Text
? How can I solve this?
Note: I am using Mono 3.0.10 on Ubuntu 12.10
I was getting this same error while working on a project. In my case it was because I did not have a properly exported TZ environment variable. I had to add the following to my UI init shell script: