circles.png
❔ Can someone explain asynchronous code?
I've read the overview with the breakfast analogy on the Microsoft docs for .NET, and still don't get
- how to use it (and efficiently)
- how .NET is able to do many things on one thread at the same time
There is one way I think I understand.
- callbacks
- when a task is done, call a function to deal with the result
- probably not very good
- JS thing
52 replies
❔ ASP.NET Core (in container) is trying to connect to another container via localhost
The connection string specifies
mongo
as the hostname, but the API still tries to connect to [::1]
which is the loopback IPv6 address (localhost)
I have a Docker Compose file with containers
- backend
: ASP.NET Core web API
- mongo
: MongoDB
which looks like this:
With the API, I followed two tutorials:
- https://learn.microsoft.com/en-us/aspnet/core/web-api/?WT.mc_id=dotnet-35129-website&view=aspnetcore-7.0
- https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mongo-app?view=aspnetcore-7.0&tabs=visual-studio-code
I then containerized it and started mongod
in a ./Data
directory.
When connecting to the database (on the mongo container) with this appsettings.json
I recieve an error from the backend container. (attached)
New to MongoDB, Docker, and ASP.NET. Let me know if you want any additional information.41 replies
❔ "Cannot assign requested address [::1]:27017" when connecting to MongoDB on Docker.
I have a Docker Compose file with containers
-
backend
: ASP.NET Core web API
- mongo
: MongoDB
which looks like this:
With the API, I followed two tutorials:
- https://learn.microsoft.com/en-us/aspnet/core/web-api/?WT.mc_id=dotnet-35129-website&view=aspnetcore-7.0
- https://learn.microsoft.com/en-us/aspnet/core/tutorials/first-mongo-app?view=aspnetcore-7.0&tabs=visual-studio-code
I then containerized it and started mongod
in a ./Data
directory.
When connecting to the database (on the mongo container) with this appsettings.json
I recieve an error from the backend container. (attached)
New to MongoDB, Docker, and ASP.NET. Let me know if you want any additional information.3 replies