Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add-Migration : Exception calling "AddFromFile" with "1" argument(s): "'basePath' cannot be an empty string ("")

I get an error when I to run add-migration with entitcore on any dotnetcore based project but the equivalent command works when targeting the full dotnetframework

Add-Migration : Exception calling "AddFromFile" with "1" argument(s): "'basePath' cannot be an empty string ("")

see a snapshot of my code. It's a dotnetcore console app. Thesame will work if created the project based on dotnetframewok 4.6.1 enter image description here

like image 549
ojorma Avatar asked Mar 16 '17 01:03

ojorma


2 Answers

Add-Migration -Name "TestMigration" -Project BTrips.Domain

Just specify -Name param

like image 67
AuthorProxy Avatar answered Sep 26 '22 02:09

AuthorProxy


I ran into the same issue. I copied the project to another path (C:\Projects) and when I tried to add the migration I got this weird error:

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Cannot find path '\HOME\Admin\Documents\Visual Studio 2017\Projects\WebApiEFCore\WebApiEFCore\obj\project.assets.json' because it does not exist.

Then I closed the solution, I opened again and I was able to add the migration.

I recreated the error creating another project in the same path I was using at the beginning, so it must be something related with the path.

Hope this could help.

like image 45
rmejias Avatar answered Sep 25 '22 02:09

rmejias