✅ Error when building ASP.NET Core 7 docker image
I have an ASP.NET Core 7 WebApi project that I am trying to dockerize, however when I try to build it the picrelated errors occur and my api project cannot build. What is the issue?
Link to repo and dockerfile (default generated by Rider): https://github.com/MindHardt/HotelRoomsService/blob/master/Dockerfile
GitHub
HotelRoomsService/Dockerfile at master · MindHardt/HotelRoomsService
Our ASP.NET Core microservice for a university course - HotelRoomsService/Dockerfile at master · MindHardt/HotelRoomsService
36 Replies
Uh, your Core.Exceptions project is targeting Microsoft.Net.Sdk, but it references namespace which is not in this sdk
thus the errors
Oh I see, thanks
I will just move the middleware into the api project
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
referencing dlls xD
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes, I've seen that evil magic Rider did
Fixed by moving middleware to the api proj
this is likely byproduct of some ide suggestion like "import references" prompt
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes, this is just a template to show other team members our workflow
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
they are grouped in solution
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yes but why this and not the way I did? I am experimenting with stuff here
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Yep
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I see your point
I guess I've never seen it this way
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
Current state is what I am familiar with and it is the way it is done at my job
Are there two approaches just alternatives or one is always preferred over other?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
How should I do this? Have a folder for each service with IService and Service files there?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
That is what I forgot, this code is kinda old when I was being familiarised with scrutor
Yes, I've seen that this part smells but haven't got time to come up with fix
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
But that would be messy If I have many services no?
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
If they all are under the same root namespace (e.g. Core.Services) why not inject them all at once
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I see your point here but I feel you've come here a bit too early for me to properly understand and feel all of these
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I really appreciate your effort, I now have things to think about
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I know for myself that I will never ever learn a thing unless I see how it helps me
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
I understand, my point was that I need to feel why my way is bad, encounter its issues to start looking for improvements
That is how I've learnt so far
But again, thanks for enlightening me, I will now at least know what to look at
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View