Deploying .net core app to docker gives “Microsoft.DotNet.Props” not found error

I am having Windows 10 Home operating system.
I have installed Docker toolbox.
I want to deploy my .net core application to Docker.
I created my Docker file by referring to following helpful article:

My docker file is as follows:

  • .Net Core Machine Key alternative for webfarm
  • Cannot find Application Insights dependency in docker image after dotnet publish
  • Error while running the ASP.NET Core WebApp on Docker in Windows 7 (Debugging)
  • Docker dotnet core nginx proxy 502
  • .NET Core publish error: “Unable to find msdeploy.exe, please install it and try again”
  • Identity Server 4 running within docker container Exception: Unable to load DLL 'System.Security.Cryptography.Native.OpenSsl'
  • FROM microsoft/dotnet:latest
    COPY . /app
    WORKDIR /app
    RUN ["dotnet", "restore"]
    RUN ["dotnet", "build"]
    EXPOSE 5000/tcp
    ENV ASPNETCORE_URLS http://*:5000
    ENTRYPOINT ["dotnet", "run"]

    But when I run, docker command for creating image, it gives me error.

    user@machine_name MINGW64 path to solution
    $  docker build -t helloWorld:core .


    /app/Web.xproj(7,3): error MSB4019: The imported project "/usr/share/dotnet/sdk/1.0.0-rc4-004771/Microsoft/VisualStudio/v14.0/DotNet/Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
    The command 'dotnet restore' returned a non-zero code: 1

    Can someone please guide, what is going wrong over here, as I am completely new to Docker.

  • Precompiled assets absent in the docker image
  • Config file for Neo4j Docker Image
  • Docker on Windows Server 2016 & microsoft-build-tools
  • Docker, CoreOS and fleet based deployments
  • What is the best practices of using Docker for front end development on OS X and passthrough ENV from host to container
  • How to run etcd cluster in docker using ansible?
  • One Solution collect form web for “Deploying .net core app to docker gives “Microsoft.DotNet.Props” not found error”

    As I see Web.xproj in your error, look like you have the same problem as described in this github issue. The root of such problem is that Microsoft updated their docker to the newest SDK which moves back to .csproj from project.json. The solution is to use another, 1.1-sdk-projectjson tag:

    FROM microsoft/dotnet:1.1-sdk-projectjson

    Note on microsoft/dotnet/ docker page:

    The latest tag no longer uses the project.json project format, but has now been updated to be csproj/MSBuild-based. If you do not wish to migrate your existing projects to MSBuild simply change your Dockerfile to use the 1.1.0-sdk-projectjson or 1.1.0-sdk-projectjson-nanoserver tag. Going forward, new .NET Core sdk images will be MSBuild-based.

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