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:
- Create a Service Fabric project in VS
- Select ASP.NET Core next
- Select WebAPI next
- 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.
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:
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.