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

Unable to use Schedule app. #36

Closed
quain24 opened this issue Oct 29, 2021 · 6 comments
Closed

Unable to use Schedule app. #36

quain24 opened this issue Oct 29, 2021 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@quain24
Copy link

quain24 commented Oct 29, 2021

After initial docker setup, with all containers running, when firing up the http://localhost:5100/
I'm welcomed with following exception in browser's console:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: String '09/23/2030 00:00:00 -04:00' was not recognized as a valid DateTime.
System.FormatException: String '09/23/2030 00:00:00 -04:00' was not recognized as a valid DateTime.
   at System.DateTimeParse.Parse(ReadOnlySpan`1 s, DateTimeFormatInfo dtfi, DateTimeStyles styles)
   at System.DateTime.Parse(String s)
   at System.Convert.ToDateTime(String value)
   at FrontDesk.Blazor.Services.ConfigurationService.ReadAsync()
   at FrontDesk.Blazor.Pages.Index.OnInitializedAsync()
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

In addition:
obraz

@ardalis
Copy link
Owner

ardalis commented Oct 29, 2021

Interesting. I guess somehow the docker container is picking up a datetime format preference from your host OS, so 9/23/2030 is being interpreted as the 9th day of the 23rd month.

Could be related: dotnet/runtime#42328
Could be used to specify locale: https://stackoverflow.com/questions/28405902/how-to-set-the-locale-inside-a-debian-ubuntu-docker-container

Is anyone else (probably in a locale that uses day/month/year) seeing this?

@ardalis ardalis added bug Something isn't working help wanted Extra attention is needed labels Oct 29, 2021
@quain24
Copy link
Author

quain24 commented Oct 29, 2021

Unfortunately I was unable to fix this issue with provided help, although I am a beginner when it comes to docker / containers / etc.
I tried to modify Dockerfile of ddd.clientmanager.blazor as follows:

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/sdk:5.0.100-rc.1-buster-slim AS build
WORKDIR /app

RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
 && locale-gen "en_US.UTF-8"
ENV LANG=en_US.UTF-8 \
    LANGUAGE=en_US:en \
    LC_ALL=en_US.UTF-8

COPY FrontDesk/src/FrontDesk.Blazor ./FrontDesk.Blazor
COPY FrontDesk/src/BlazorShared ./BlazorShared
RUN dotnet restore /app/FrontDesk.Blazor/FrontDesk.Blazor.csproj

WORKDIR /app/FrontDesk.Blazor
RUN dotnet build -c Release -o /bin/Release/net5.0

FROM build AS publish
RUN dotnet publish -c Release -o /bin/Release/net5.0/browser-wasm/publish

FROM nginx:alpine AS final

WORKDIR /usr/share/nginx/html

COPY --from=publish /bin/Release/net5.0/browser-wasm/publish/wwwroot /usr/local/webapp/nginx/html
COPY --from=build /bin/Release/net5.0/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

@ardalis
Copy link
Owner

ardalis commented Oct 29, 2021

Are you able to build locally? Docker is an option, and usually an easier one, but not the only one.

@quain24
Copy link
Author

quain24 commented Oct 29, 2021

Yes, with suggested rabbit-mq container spun up I am able to run FrontDesk.Blazor from VS.
My main concern is that I wanted to see all of this working as one, as presented in Your Pluralsight course.

@ardalis
Copy link
Owner

ardalis commented Oct 30, 2021

You can do that by just having multiple visual studio instances (or terminals) running, and run each of the apps on their own ports. The table in the README shows the ports that should be in use when you do this yourself vs. in docker. When I'm working with it locally and troubleshooting, debugging, or even developing this is how I run it.

matheuspenido added a commit to matheuspenido/pluralsight-ddd-fundamentals that referenced this issue May 9, 2022
matheuspenido added a commit to matheuspenido/pluralsight-ddd-fundamentals that referenced this issue May 9, 2022
ardalis added a commit that referenced this issue Jun 21, 2022
@ardalis
Copy link
Owner

ardalis commented Jun 21, 2022

I think this is now fixed - let me know if it's still an issue.

@ardalis ardalis closed this as completed Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants