1

I'm stuck for using EF command with docker support on an ASP.NET Core project.

I created an ASP.NET Core API basic project using Visual Studio 2017 RC.

I added dependencies and configurations needed by Entity Framework to work.

I ran Add-migration "name" and Update-database and everything works fine as expected.

But since I added Docker support on the project, I receive the error below each time I run an EF command:

Add-migration : Cannot bind argument to parameter 'Path' because it is an empty string.

 At line:1 char:1
+ Add-migration init-database
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Add-Migration], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Add-Migration

As I saw on many tutorials, there is no need to update Docker file or Docker compose file in order to make EF commands available but maybe I'm wrong.

PS: Docker works pretty fine, I'm able to run the project through Docker without any problems. Since Docker support creates another project in the solution, I already tried to go on the app project path to run the command instead of solution path, but it doesn't change anything.

juunas
  • 54,244
  • 13
  • 113
  • 149
Hayha
  • 2,144
  • 1
  • 15
  • 27
  • http://stackoverflow.com/questions/14410987/entity-framework-code-first-migration-error – Venkata Dorisala Feb 10 '17 at 22:53
  • It's definitely not my case, i'm using Entity Framework Core with latest dotnet core on visual studio 2017 RC through Docker Support and as I said, I was able to add migration before the docker support was added. But i think, my problem is a bug related to visual studio 2017 RC and Docker support, as i tested the same scenario on visual studio 2015 and everythings works fine. – Hayha Feb 11 '17 at 14:42
  • @BriceMolesti I have the same problem. Created new project with docker support and I've been getting this error also... – Kryptoxx Feb 22 '17 at 09:42
  • @Kryptoxx If you're still stuck on this problem, check my answer bellow. – Hayha Mar 08 '17 at 19:53

1 Answers1

0

Enable docker support add the project "docker-compose" to the solution.

So just set your initial app project as the startup project fix the problem

Or run any EF Command with -startupproject "yourinitialappproject"

Hayha
  • 2,144
  • 1
  • 15
  • 27