title: Visual Studio Docker Support - Debugging with a Dockerfile outside of the startup project folder
body: <p>I have a docker file for a .NET Core project that references some library projects in the same solution.</p>
  
  <p>Given that Docker does not allow copying files from outside of the parent directory (<a href="https://stackoverflow.com/questions/24537340/docker-adding-a-file-from-a-parent-directory">Docker: adding a file from a parent directory</a>), I have to keep my Dockerfile outside of the executable (start up) project directory. </p>
  
  <p><strong>So, how do I use Visual Studio debugging with a Dockerfile that is not located within the executable project?</strong> </p>
  
  <p>It seems that Visual Studio only works with the Docker debug profile if it can find a Dockerfile in the directory for the startup project.</p>
  
  <p><a href="https://i.stack.imgur.com/eKP6A.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eKP6A.png" alt="enter image description here"></a></p>
  
  <p>When the Dockerfile is not present in the startup directory, the build error points at lines in a file named Container.targets, located at:</p>
  
  <p><code>C:\Users&lt;user&gt;\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.4.10\build</code></p>
  
  <pre><code>&lt;Target Name="ContainerPrepareForLaunch" Condition="Exists('$(ContainerSemaphoreFilePath)')"&gt;
      &lt;PrepareForLaunch DevelopmentMode="$(ContainerDevelopmentMode)"
                        DevEnvDir="$(DevEnvDir)"
                        Dockerfiles="@(_Dockerfile)" 
                        IntermediateOutputPath="$(ContainerIntermediateOutputPath)"
                        ProjectCapability="@(ProjectCapability)"
                        ProjectFilePath="$(MSBuildProjectFullPath)" 
                        NuGetPackageFolders="$(NuGetPackageFolders)"
                        NuGetPackageRoot="$(NuGetPackageRoot)"
                        TargetFrameworkWithVersion ="$(TargetFramework)"
                        TargetPath="$(TargetPath)"
                        ErrorLogFilePath="$(ContainerSemaphoreFilePath)"
                        DockerLabelBuiltImages="$(DockerLabelBuiltImages)"
                        DockerImageLabel="$(DockerImageLabel)" 
                        ProjectTypeGuids="$(ProjectTypeGuids)" /&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p>However I need to be able to manage the path to the Dockerfile on a per-project basis.</p>