Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeZone issues related to Mono? #16142

Closed
chassq opened this issue Apr 24, 2018 · 5 comments
Closed

TimeZone issues related to Mono? #16142

chassq opened this issue Apr 24, 2018 · 5 comments
Labels
area-blazor Includes: Blazor, Razor Components

Comments

@chassq
Copy link
Contributor

chassq commented Apr 24, 2018

Just wanted to report I am seeing issues with timezone related code. See:

ERROR

MonoPlatform.ts:70 Uncaught Error: System.TimeZoneNotFoundException: Couldn't read time zone file /usr/share/zoneinfo/Eastern Standard Time ---> System.IO.DirectoryNotFoundException: Could not find a part of the path "/usr/share/zoneinfo/Eastern Standard Time".
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x1f623d8 + 0x00226> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) <0x1f5a478 + 0x00032> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.IO.File.OpenRead (System.String path) <0x1f5a180 + 0x0000e> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) <0x1f59ef0 + 0x00014> in <031009ec673a4a808e11b357311ab8f4>:0 
   --- End of inner exception stack trace ---
  at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) <0x1f59ef0 + 0x00038> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneByIdCore (System.String id) <0x1f596d0 + 0x0001e> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneById (System.String id) <0x1f594e8 + 0x00030> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId (System.DateTimeOffset dateTimeOffset, System.String destinationTimeZoneId) <0x1f59398 + 0x00018> in <031009ec673a4a808e11b357311ab8f4>:0 
  at lib.shared.util.Helper.DateTimeHelper.GetEstFromUtc () <0x1f53c90 + 0x00012> in <ea87f8326c3d4dca87bad74658f34e5b>:0 
  at TestBlazor_0_2_0.Client.Pages.Test.TestLibSharedUtilHelper.RunTests () <0x1f53a78 + 0x00022> in <9ce1d538f01b40c39a6a753959ed2ef0>:0 
  at Microsoft.AspNetCore.Blazor.Rendering.Renderer+<>c__DisplayClass13_0.<AssignEventHandlerId>b__0 (Microsoft.AspNetCore.Blazor.UIEventArgs e) <0x1f53908 + 0x00014> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Components.BlazorComponent.Microsoft.AspNetCore.Blazor.Components.IHandleEvent.HandleEvent (Microsoft.AspNetCore.Blazor.UIEventHandler handler, Microsoft.AspNetCore.Blazor.UIEventArgs args) <0x1f53798 + 0x00018> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Rendering.ComponentState.DispatchEvent (Microsoft.AspNetCore.Blazor.UIEventHandler handler, Microsoft.AspNetCore.Blazor.UIEventArgs eventArgs) <0x1f535c0 + 0x00034> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Rendering.Renderer.DispatchEvent (System.Int32 componentId, System.Int32 eventHandlerId, Microsoft.AspNetCore.Blazor.UIEventArgs eventArgs) <0x1f53088 + 0x00050> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Browser.Rendering.BrowserRenderer.DispatchBrowserEvent (System.Int32 componentId, System.Int32 eventHandlerId, Microsoft.AspNetCore.Blazor.UIEventArgs eventArgs) <0x1f52f20 + 0x00020> in <08ceae4b872f4f8d8ccefc410a9a8971>:0 
  at Microsoft.AspNetCore.Blazor.Browser.Rendering.BrowserRendererEventDispatcher.DispatchEvent (System.String eventDescriptorJson, System.String eventArgsJson) <0x1f11940 + 0x0005a> in <08ceae4b872f4f8d8ccefc410a9a8971>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) <0x1f623d8 + 0x00226> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share) <0x1f5a478 + 0x00032> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.IO.File.OpenRead (System.String path) <0x1f5a180 + 0x0000e> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) <0x1f59ef0 + 0x00014> in <031009ec673a4a808e11b357311ab8f4>:0 
   --- End of inner exception stack trace ---
  at System.TimeZoneInfo.FindSystemTimeZoneByFileName (System.String id, System.String filepath) <0x1f59ef0 + 0x00038> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneByIdCore (System.String id) <0x1f596d0 + 0x0001e> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.FindSystemTimeZoneById (System.String id) <0x1f594e8 + 0x00030> in <031009ec673a4a808e11b357311ab8f4>:0 
  at System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId (System.DateTimeOffset dateTimeOffset, System.String destinationTimeZoneId) <0x1f59398 + 0x00018> in <031009ec673a4a808e11b357311ab8f4>:0 
  at lib.shared.util.Helper.DateTimeHelper.GetEstFromUtc () <0x1f53c90 + 0x00012> in <ea87f8326c3d4dca87bad74658f34e5b>:0 
  at TestBlazor_0_2_0.Client.Pages.Test.TestLibSharedUtilHelper.RunTests () <0x1f53a78 + 0x00022> in <9ce1d538f01b40c39a6a753959ed2ef0>:0 
  at Microsoft.AspNetCore.Blazor.Rendering.Renderer+<>c__DisplayClass13_0.<AssignEventHandlerId>b__0 (Microsoft.AspNetCore.Blazor.UIEventArgs e) <0x1f53908 + 0x00014> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Components.BlazorComponent.Microsoft.AspNetCore.Blazor.Components.IHandleEvent.HandleEvent (Microsoft.AspNetCore.Blazor.UIEventHandler handler, Microsoft.AspNetCore.Blazor.UIEventArgs args) <0x1f53798 + 0x00018> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Rendering.ComponentState.DispatchEvent (Microsoft.AspNetCore.Blazor.UIEventHandler handler, Microsoft.AspNetCore.Blazor.UIEventArgs eventArgs) <0x1f535c0 + 0x00034> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Rendering.Renderer.DispatchEvent (System.Int32 componentId, System.Int32 eventHandlerId, Microsoft.AspNetCore.Blazor.UIEventArgs eventArgs) <0x1f53088 + 0x00050> in <8a8022566b074cca8a70e10050945cdd>:0 
  at Microsoft.AspNetCore.Blazor.Browser.Rendering.BrowserRenderer.DispatchBrowserEvent (System.Int32 componentId, System.Int32 eventHandlerId, Microsoft.AspNetCore.Blazor.UIEventArgs eventArgs) <0x1f52f20 + 0x00020> in <08ceae4b872f4f8d8ccefc410a9a8971>:0 
  at Microsoft.AspNetCore.Blazor.Browser.Rendering.BrowserRendererEventDispatcher.DispatchEvent (System.String eventDescriptorJson, System.String eventArgsJson) <0x1f11940 + 0x0005a> in <08ceae4b872f4f8d8ccefc410a9a8971>:0 
    at Object.callMethod (http://localhost:49819/_framework/blazor.js:435:23)
    at raiseEvent (http://localhost:49819/_framework/blazor.js:949:28)
    at EventDelegator.onEvent (http://localhost:49819/_framework/blazor.js:692:13)
    at EventDelegator.onGlobalEvent (http://localhost:49819/_framework/blazor.js:1096:26)
callMethod @ MonoPlatform.ts:70
raiseEvent @ BrowserRenderer.ts:304
(anonymous) @ BrowserRenderer.ts:17
EventDelegator.onGlobalEvent @ EventDelegator.ts:77

CODE: - Works fine on server just not in blazor/mono

@using lib.shared.util.Helper
@page "/test/libsharedutilhelper"

<h3>Test Lib.Shared.Util.Heplers</h3>
<p>Test a bunch of static helpers for fun :-)</p>

<button onclick=@RunTests>Run Tests</button>
<p>@TestList</p>

@functions {

    string TestList = "";

    private void RunTests()
    {
        TestList = "Init...";
        TestList += "<br />Get Est From Utc: " + TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTimeOffset.UtcNow, "Eastern Standard Time").ToString();
    }
}

I looked at some articles and they suggested this is a mono issue?
https://bugzilla.xamarin.com/show_bug.cgi?id=11817
https://bugzilla.xamarin.com/show_bug.cgi?id=31432
https://stackoverflow.com/questions/18395018/system-timezonenotfoundexception-on-viewpage-using-servicestack-razor
https://www.reddit.com/r/jailbreak/comments/3ll1rf/tutorial_solution_how_to_fix_broken_timezone_in/

Kind of an essential missing piece.. Any workaround ideas? Thoughts?

@Daddoon
Copy link

Daddoon commented Apr 24, 2018

Are you getting an exception when enumerating the TimeZones ?

Like:

tz= TimeZoneInfo.GetSystemTimeZones();

on stackoverflow

@chassq
Copy link
Contributor Author

chassq commented Apr 24, 2018

Does not throw an exception. There are not any timezones in the readonly collection.

Should Add I am using:
VS 2017 15.7.0 Preview 4.0
Dotnet SDK 2.1.300-preview2-008533
Blazor Language Services 0.2.1-rtm-10237
Chrome 66.0.3359.117
Windows Server 2016 Datacenter (Azure VM for VS preview)

@Daddoon
Copy link

Daddoon commented Apr 24, 2018

I think it's a missing reference, maybe stripped at build ?
I think only MS team will be able to see this.

@SteveSandersonMS
Copy link
Member

This is an issue in Mono. Would you be willing to report it to https://github.com/mono/mono/? Thanks!

@chassq
Copy link
Contributor Author

chassq commented Apr 24, 2018

Issue: mono/mono#8443

@mkArtakMSFT mkArtakMSFT transferred this issue from dotnet/blazor Oct 27, 2019
@mkArtakMSFT mkArtakMSFT added the area-blazor Includes: Blazor, Razor Components label Oct 27, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

No branches or pull requests

4 participants