Skip to content

Generated Dockerfile does not copy .dcproj into the container #87

@natemcmaster

Description

@natemcmaster

The current VS tooling generates a Dockerfile that looks like this:

FROM microsoft/aspnetcore-build:2.0 AS build WORKDIR /src COPY HelloWorld.sln ./ COPY HelloWorld/HelloWorld.csproj HelloWorld/ RUN dotnet restore -nowarn:msb3202,nu1503

This file does not copy the .dcproj into the container, even though the .sln file references the .dcproj. This was done to workaround a different error, error: MSB4236: The SDK 'Microsoft.Docker.Sdk' specified could not be found which happens when the .dcproj is present. However, this means the project setup is malformed. -nowarn:MSB3202 was added to suppress a legitimate warning about the malformed project setup. As we experienced between the 2.1.4 and 2.1.101 update, NuGet by default no longer coerces MSB3202 from an error to a warning, so -nowarn:MSB3202 does not prevent dotnet restore from failing.

Suggestion
Change the generated Dockerfile to include the .dcproj file when building inside the container, and let's find a way to solve the issue with MSB4236. Obviously, this needs more discussion as there are a few ways to do this, and we need to consider the impact of all them on the dotnet CLI, VS, Docker, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions