C
C#2y ago
mindhardt

✅ 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
Tinefol
Tinefol2y ago
Uh, your Core.Exceptions project is targeting Microsoft.Net.Sdk, but it references namespace which is not in this sdk thus the errors
mindhardt
mindhardtOP2y ago
Oh I see, thanks I will just move the middleware into the api project
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Tinefol
Tinefol2y ago
referencing dlls xD
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
Yes, I've seen that evil magic Rider did Fixed by moving middleware to the api proj
Tinefol
Tinefol2y ago
this is likely byproduct of some ide suggestion like "import references" prompt
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
Yes, this is just a template to show other team members our workflow
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
they are grouped in solution
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
Yes but why this and not the way I did? I am experimenting with stuff here
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
Yep
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
I see your point I guess I've never seen it this way
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
How should I do this? Have a folder for each service with IService and Service files there?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
But that would be messy If I have many services no?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
If they all are under the same root namespace (e.g. Core.Services) why not inject them all at once
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
I really appreciate your effort, I now have things to think about
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
I know for myself that I will never ever learn a thing unless I see how it helps me
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
mindhardt
mindhardtOP2y ago
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
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server