VS 2017 Add > Docker Support breaks build – “CleanWorkspace” task failed unexpectedly (console app)

First off I’m using .NET 4.6.1. Does Docker with VS 2017 not work with anything but .NET Core?

I used the new feature Add > Docker Support from the context menu, and it created a bunch of files. Here’s my Dockerfile (haven’t touched it since it was auto-created):

  • Only first line being read in Dockerfile
  • Create long running .NET Core service targeting Linux Docker container
  • How to check that a local URL is reachable
  • How to perform code analysis in sonarqube in docker in a ASP.NET web application
  • during startup program exited normally. segmentation fault
  • Cannot connect to WCF service hosted in Docker container
  • FROM microsoft/windowsservercore
    ARG source
    WORKDIR /app
    COPY ${source:-obj/Docker/publish} .
    ENTRYPOINT ["C:\app\nameofmyapp.exe"]
    

    When I build, I get the following error:

    The “CleanWorkspace” task failed unexpectedly.
    Microsoft.DotNet.Docker.CommandLineClientException: The Compose file
    ‘…\docker-compose.yml’
    is invalid because: services.pas.parsemicroservice.build.context
    contains null, which is an invalid type, it should be a string.

    Here’s my docker-compose.yml file:

    version: '2.1'
    
    services:
      pas.parsemicroservice:
        image: pas.parsemicroservice
        build:
          context: 
          dockerfile: Dockerfile
    

    If I add a . to context (as the error implies the null there is the problem), I get a different error:

    There is a circular dependency in the target dependency graph
    involving target “DockerCleanServiceReferences”.

    Is this all a result of using the wrong .NET framework, or are my files set up wrong? (I am a Docker n00b to be sure.)

  • How to connect two HA group containers in Bluemix?
  • How do I change permissions in a docker volume?
  • Why nobody does not make it in the docker? (All-in-one container/“black box”)
  • Could not find jenkins_home folder in Ubuntu after downloading the Docker Jenkins Image
  • docker swarm http connectivity
  • docker registry with s3
  • One Solution collect form web for “VS 2017 Add > Docker Support breaks build – “CleanWorkspace” task failed unexpectedly (console app)”

    Update: Regarding your circular dependency issue, make sure your SLN and CSPROJ files are not in the same folder. Meaning that when you first create a solution, make sure to check the box that says “create directory for solution”.

    Docker support for non .Net Core applications is definitely supported in VS 2017 as shown at the 9:15 mark of this video https://channel9.msdn.com/Events/Visual-Studio/Visual-Studio-2017-Launch/T111

    Your context should point to the directory where your Dockerfile exists. This path should be relative to where your docker-compose.yml file is located.

    Compose file version 2 Reference: https://docs.docker.com/compose/compose-file/compose-file-v2/#context

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.