Skip to content

EntityFramework Core Scaffolding error - Cannot find path '[path]' because it does not exist. #10327

@ajcvickers

Description

@ajcvickers

From VS issues:

Customer created an ASP.NET Core project in Visual Studio and wanted to reverse engineer his database into an EF model using the Scaffold-DbContext from EF Core. However when he ran this command from the Package Manager Console:

Scaffold-DbContext 'Server=###########.database.windows.net;Database=###########;user id=#########;password=#######;' Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models

He received the following error message:

The running command stopped because the preference variable 'ErrorActionPreference' or common parameter is set to Stop: Cannot find path 'C:\Users\Backup\Source\Repos\Xxxx\ServiceFabric\CoreAPI\CoreAPI\CoreAPI.sfproj\bin\Debug\' because it does not exist.

Repro steps:

  1. Create a Service Fabric project in VS
  2. Select ASP.NET Core next
  3. Select WebAPI next
  4. Run Scaffold-DbContext (I used https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/existing-db as the basis for the repro)

Result: The running command stopped because the preference variable 'ErrorActionPreference' or common parameter is set to Stop: Cannot find path 'C:\Users\Backup\Source\Repos\Xxxx\ServiceFabric\CoreAPI\CoreAPI\CoreAPI.sfproj\bin\Debug\' because it does not exist.

Workaround: If you ensure that the ASP.NET Core project is set to the startup project, it resolves the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions