efcore: PMC Tools: Error when project opened from a file share
Moved from https://github.com/aspnet/EntityFramework.Docs/issues/346 cc @Klipi
I’m following the tutorial here: https://docs.microsoft.com/en-us/ef/core/get-started/aspnetcore/new-db up to the point where I need to run the first migration:
PM> Add-Migration MyFirstMigration
Unable to resolve startup project 'Microsoft.PowerShell.Core\FileSystem::\\mac\home\documents\visual studio 2017\Projects\EFGetStarted.AspNetCore.NewDb\EFGetStarted.AspNetCore.NewDb\EFGetStarted.AspNetCore.NewDb.csproj'.
To undo this action, use Remove-Migration.
Add-Migration : Exception calling "AddFromFile" with "1" argument(s): "'basePath' cannot be an empty string ("") or start with the null character.
Parameter name: basePath"
At line:1 char:1
+ Add-Migration MyFirstMigration
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Add-Migration], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentException,Add-Migration
I’m running Visual Studio 2017 RC3 under a Win10 VM in Parallels, so that might be the cause of some issues. However I have no idea on how to start to debug this, as I’m quite new to the .NET Core world and Entity Framework.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 37 (6 by maintainers)
lol, this is really strange… I just keep flooding the PMC and in the end it works… (the flood “up + enter” was about 1 per second)
@imad24 glad u fixed it. I even went to the extent of living just one table in the dbcontext and still got the error but I never checked the table it self. That error message is highly misleading. I guess Entityframework core is still evolving.
@imad24
To be honest, it seems that doesnt even reach the point to scaffold something…
while the project is open in visual studio type dotnet alone and dotnet --version. Let see what gets invoked
Lastly if its a demo project you can send to my email. Dont know if its allowed here. ojunix@hotmail.com.
Let me check if it runs. if not I will assume its some wrong reference from nugget package.
@dotnetnoobi @rowanmiller it turns out the problem is caused as a result of having multiple dotnetsdk and the wrong one been called in the environmental variables. if you dont want to uninstall the earlier sdk make sure you move
i moved the 64bit dotcli path up (C:\Program Files\dotnet ) which had the current sdk
@bricelam I am not using docker Just a standard projects
AspNetCore 1.1 app which references Class Library
I have the DataContext objects on a separate project which is a .NetCore App 1.1 (Class Library)
I set the “Default Project” in the “Package Manager Console” from the dropdown but I did not use this “-StartupProject” option in the commands