0
Refer to Docker-Compose reading of Appsettings. When I run through Docker-Compose, I can’t load the file appsettings.
That’s why, only when run by Docker-Compose it does not find the Appsettings session and I get a object reference
on line 19.
I was able to analyze that:
That mistake only happens when I run Docker-Compose via command-line. That is, starting the application by visual studio, it reads the appsettings correctly. Even I’ve even run a Publish and locally startei successfully through the published . dll.
Desired configuration in appsettings.Production.json (i even put on all to see if the problem was something with Environment, but it seems to be even about reading Appsettings in the file).
access the container and check the file paths. Remember that if you are using linux containers, the paths are case sensitive, to avoid problems can use everything tiny. Put logs in the tbm app to validate if you loaded the files correctly
– Ricardo Pontual
I copy everything into a folder /app, the contents of this is item 2 I marked. About being case sensitive, I try to read the session "Appsettings" as it is in the file, and Environment I define as - ASPNETCORE_ENVIRONMENT=Production, I think they are the points where it would disturb, I do not see another in mind. The file of the Compose is in LF format.
– Gabriel Braga
Actually, I reviewed it carefully and it was an appsettings call. You can post as an answer in case someone goes through it.
– Gabriel Braga