I have an ASP.Net Core 3.1 solution that uses a Docker Compose file as its startup project. Calling the method
Directory.GetCurrentDirectory() from anywhere in the code returns the string
/app, which is weird as I was expecting this string to include
/bin/Debug/netcoreapp3.1 or (
Release if I build the code in release mode). If I go into the docker container that runs the code, the executing code is located at
What is going on?
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.