Entity framework 7 with Microsoft SQL server not working in Docker

I am using EntityFramework 7 with Microsoft SQL server in asp.net 5. I am using EntityFramework.MicrosoftSqlServer: 7.0.0-rc1-final.
When I run my web application in visual studio everything it works as expected.
But, I want to run my application in Docker. I am using official Docker image for running asp.net application:

Here is my dockerfile:

  • Docker ASP.net 5 beta4 kestrel doesn't keep container running
  • Dealing with “HTTP request timed out. Exiting.” when building a large aspnet project for Docker
  • ASP.NET on Docker Not Serving Web App to Browser
  • Does Azure Service Fabric do the same thing as Docker?
  • As a asp.net MVC dev, Why and when to use a docker?
  • asp.net MVC 5 hosting setup
  • FROM microsoft/aspnet:1.0.0-rc1-update1-coreclr

    COPY project.json /app/

    WORKDIR /app

    RUN [“dnu“, “restore”]

    COPY . /app





    ENTRYPOINT [“dnx”, “-p”, “project.json”, “web”]

    Build is successful in docker, but when I run application I get following error after application starts:

    Application startup exception: System.IO.FileLoadException: Could not load file or assembly ‘app, Culture=neutral, PublicKeyToken=null’ or one of its dependencies. General Exception (Exception from HRESULT: 0x80131500)
    [36mwebapi_1 | [0mFile name: ‘app, Culture=neutral, PublicKeyToken=null’ —> Microsoft.Dnx.Compilation.CSharp.RoslynCompilationException: /app/Startup.cs(33,18): DNXCore,Version=v5.0 error CS1061: ‘EntityFrameworkServicesBuilder’ does not contain a definition for ‘AddSqlServer’ and no extension method ‘AddSqlServer’ accepting a first argument of type ‘EntityFrameworkServicesBuilder’ could be found (are you missing a using directive or an assembly reference?)

    The problem seems to be in ‘AddSqlServer’ command. Strange thing is that it works when built and runt from visual studio. Does anyone know something about this problem?


  • using syslog to ship the docker container logs to logstash
  • Docker Cloud Disable service endpoints
  • Mysql installation on docker container
  • How to save transfer cache to a different host from a docker-compose build
  • Database created in Dockerfile does not appear in running container
  • Mapping volumes to include subfolders in docker-compose
  • One Solution collect form web for “Entity framework 7 with Microsoft SQL server not working in Docker”

    Try explicitly sharing your drive with the Docker host. If you are using docker-machine, this is under the settings for default in Virtual Box. If you have the Docker for Windows beta, you can do it in the settings from the task bar icon. It may not be that the extension method is missing, only that Docker can’t access it.

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