<t>The way Visual Studio does it is a little bit odd.<br/>
<br/>
Instead of launching docker build in the folder with the Dockerfile, it launches in the parent folder and specifies the Dockerfile with the -f option.<br/>
<br/>
I was using the demo project (trying to create a minimal solution for another question) and struck the same situation.<br/>
<br/>
Setup for my demo project is<br/>
<br/>
\WorkerService2 ("solution" folder)<br/>
+- WorkerService2.sln<br/>
+- WorkserService2 ("project" folder)<br/>
+- DockerFile<br/>
+- WorkerService2.csproj<br/>
+- ... other program files<br/>
<br/>
```<br/>
<br/>
So I would **expect** to go<br/>
<br/>
```<br/>
cd \Workerservice2\WorkerService2<br/>
docker build .<br/>
<br/>
```<br/>
<br/>
But I get your error message.<br/>
<br/>
```<br/>
=> ERROR [build 3/7] COPY [WorkerService2/WorkerService2.csproj, WorkerService2/] 0.0s<br/>
------<br/>
> [build 3/7] COPY [WorkerService2/WorkerService2.csproj, WorkerService2/]:<br/>
------<br/>
failed to compute cache key: "/WorkerService2/WorkerService2.csproj" not found: not found<br/>
<br/>
```<br/>
<br/>
Instead, go to the parent directory, with the `.sln` file and use the docker `-f` option to specify the Dockerfile to use in the subfolder:<br/>
<br/>
```<br/>
cd \Workerservice2<br/>
docker build -f WorkerService2\Dockerfile --force-rm -t worker2/try7 .<br/>
<br/>
docker run -it worker2/try7 <br/>
<br/>
```<br/>
<br/>
Note the final dot on the `docker build` command.<br/>
<br/>
For docker the final part of the command is the location of the files that Docker will work with. *Usually* this is the folder with the Dockerfile in, but that's what's different about how VS does it. In this case the dockerfile is specified with the `-f`. Any paths (such as with the `COPY` instruction in the dockerfile) are relative to the location specified. The `.` means "current directory", which in my example is `\WorkerService2`.<br/>
<br/>
I got to this stage by inspecting the output of the build process, with verbosity set to Detailed.<br/>
If you choose Tools / Options / Projects and Solutions / Bu<br/>
<br/>
*(Réponse tronquée)*</t>