runtime: TimeZoneNotFoundException: The time zone ID 'America/Chicago' was not found on the local computer.
I am using .NET RC1 Blazor WebAssembly Hosted App. In my published app to Azure AppService(windows) which is deployed as self-contained i am running into timezone error. The app works fine when running on my local dev box
In my Server Controller, i am trying to find the Timezone of business location as shown below.
var timezoneLocation = TimeZoneInfo.FindSystemTimeZoneById(LocalTimeAtOrgLocation);
but i get the following error.
Error Occured in OrganizationController.GetActiveTokenAtOrgLocationTerminal System.TimeZoneNotFoundException: The time zone ID 'America/Chicago' was not found on the local computer.
at System.TimeZoneInfo.FindSystemTimeZoneById(String id)
at XXXXXV6New.Server.Controllers.OrganizationController.GetActiveTokenAtOrgLocationTerminal(Nullable`1 OrgLocationTerminalID) in C:\Users\admin\source\repos\XXXXXXXV6New\Server\Controllers\OrganizationController.cs:line 2995
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 49 (28 by maintainers)
@nssidhu looks like Azure App Services will url decode all incoming routes. In your case, this results in the app selecting the fallback route because there isn’t a route that matches
api/WeatherForecast/GetTimeZonetime/{a}/{b}. Changing the route parameter to a catch-all parameter should resolve this issue and make it so that it works locally and on App Services:I don’t really care about mitigating the CI issues. Now that I know that it can “randomly” not work on some customers’ machines I don’t think I want to use the feature. That’s not something that a library can enforce.
works after deploying on the new instance of Azure app service. Looks like Azure App service should have option to clean install(i.e. delete everything including temp files)
Again, I am talking about Blazor server side error and not client(wasm), I just happen to use Blazor wasm hosted project. Re-iterating because it is very easy to get confused, The error happens in the hosted server project and not the client(wasm). Also i made the repo public so it should be accessible.