I am trying to build a docker image from a visual studio solution that consists of two projects:
- one project contains common code (http methods, logging etc)
- the other is the business logic and application
I can build and run in Visual Studio, which produces a Docker image that I am able to deploy to our test environment. However, any POSTs sent to the API in the test environment return a 500 error. I can see references like: '/Users/Tim/Documents/Dotnet Code/dotnetcore-app/App/MyClass.cs' in the error response, which leads me to suspect there is something up with the image - that path is on my laptop.
Hoping someone else may have come across something similar, or could provide some pointers about building a multi project solution like this into a Docker container.
Disclaimer: this is my first time working with dotnet core and visual studio - I have some experience with docker.
ProjectReference. 2) Copy statements as in the main answer, may be incorrect. 3) Docker can think it's targeting Windows when it shouldn't... for me, this was due to a corrupt Docker for Windows install.