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):

  • Docker does not follow symlinks within build directory
  • Cant access my Docker DotNet core website
  • Error while publising to docker on Azure from Visual Studio 2015
  • ERROR: 'ascii' codec can't decode byte 0xe2 in position 91: ordinal not in range(128)
  • Node C++ extension loading in docker only Segfault on Google Compute Engine
  • Mono TLS1.2 issues - btls-cert-sync “command not found”
  • 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
    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'
        image: pas.parsemicroservice
          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.)

  • Docker impossible to link nginx container with php-fpm container
  • Forbid docker to use specific network
  • docker API v2 - how to tag and push an image
  • Migrating existing Docker containers to Docker Compose
  • using environment variables in docker
  • Ultraedit docker syntax hightlighting file
  • 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.