-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PMC Tools: Error when project opened from a file share #7540
Comments
Copying this over from the documentation side
I'll try to redo the tutorial under C:\ and see what happens. Not sure if anything else is breaking, been away from Windows and VS for a couple of years. A quick HelloWorld-type web app works nicely and I was even able to publish it to Azure without a hitch. Trying to add the database layer (and EF along it) is the first I'm running into trouble. |
@bricelam, No issue running under C:\ |
Groovy. I suspect this is the root of our problems:
|
im having a similar issue except that im not in a file share. I just got vs2017 and i get this error when i try to add-migration `add-migration : Exception calling "AddFromFile" with "1" argument(s): "'basePath' cannot be an empty string ("") or start with the null character.
` |
I have the same error message as @ojorma I am using a class library for the DataContext Objects I only get this error with the DataContext which also is the context object which is used for ApplicationDbContext When I try it with other DataContext objects which are for small stand alone databases I don't get the error. I also noticed that when I tried to run the web app and use the build in apply migrations button that EF-Core could not login to the database and was trying to use my Microsoft Login for the Windows/Microsoft Account, even when I have set the connection string in the app settings to use a trusted connection. The message asked me to create the migration manually for the ApplicationDbContext Once I had done this manually via the nuget command window in VS2017 I was then able to create the same migration which I got the above error for |
@ojorma @dotnetnoobie Are you using Docker? You may be hitting #7439. (Workaround: Pass your web app as |
@bricelam I am using a console app. I first tried it with a class library but thesame thing so i tried it again in a console app. I just got vs2017 and testing the basic stuff out. I got burnt with version 1.0 cause of entityframework core. |
@bricelam @rowanmiller @dotnetnoobie |
@bricelam I am not using docker AspNetCore 1.1 app which references Class Library I have the DataContext objects on a separate project which is a I set the "Default Project" in the "Package Manager Console" from the dropdown |
@bricelam I also had problems with the class library originally This seemed to solve the issues I has of not actually having all the correct nuget packages referenced to get everything working |
@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 |
Hello @ojorma, |
@imad24 when you type dotnet --version in the command line what does it give you? this is mine |
@ojorma I've got the same version as you can see (along with two others installed i think) @bricelam Everything seems ok with the Powershell commands as well: @ojorma I'll try to install the x86 version as you suggested, then give it another try with a sample project. I'll send you a link if it still not work. |
@imad24 im seeing 1.0.0-preview2-1...... That means there are multiple sdks on your system.
I think visual studio is some how invoking the older sdks. Please let us know your outcome. Good luck |
@ojorma I didnt want to delete the older preview version because I have other projects pointing to them that I haven't migrated yet. But I thought since the "dotnet --version" is displaying "1.0.0" then the right SDK is used. Anyway: Next i'll install and try with the x86 version. I'll keep you updated. |
Hello again @ojorma, After installing the x86 version I realized the 1.0.1 skd was out, so installed the 1.0.1 x64 and made the same tests, I even inverted the env variables, still nothing. Here is a screenshot of most of the tests I made, I dont think it's related to the multiple SDKs as you can see (PM console VS cmd console) Please tell me if you have other suggestions. |
while the project is open in visual studio type dotnet alone and dotnet --version. Let see what gets invoked |
@ojorma I'm sending you the project by email. |
Hello everyone, Thanks for your help @ojorma |
@Cae2 For me it was related to the model classes, there were some errors so the migration was raising this "generic error". |
@Cae2 Well, it may be something else. |
@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. |
What type of project are you using? This may be an issue with the new project system... |
I am getting the same error as well on new Class Library (.NET Standard) project while trying to do database first initialisation with connection string:
My scenario is to create a common .NET Standard library so that it can be used in both .NET Core and Xamarin projects. Can someone please point out if I am on right path. The error message isn't helping much. Thank you. |
@themausam I dont think codefirst can run from a .netstandard library |
I can confirm that this has to do with invalid data modelling. Had this issue as well with a type on an inverse property attribute causing the generic error. Then fixing that, I got informed about another incorrect configuration (proper exception message). Fixed that but then again forgot to remove a navigation property on dependent entity and the generic error message was back. |
I can make this another issue if needed I started getting error out of nowhere (I did upgrade by VS2017 Preview verison, but doubt that has reference). I have a Dot Net Core 2 Console App (2.0.0-preview1-005977) that I am using to do Migrations using Package Manager. The Context is in a .Net Standard 2.0(2.0.0-preview1-25301-01) CL. Here is my Context and the Factory
I have the Console Project as Startup and the Default Project the CL and when I run Add-Migrations Test, I get
And if I set the CL as the Startup project, I get
This was working fine but all of a sudden it isn't. All my nuget packages are from 5/9 so I am totally lost here. |
@isaac2004 - See #8731 |
I got the same issue as well, I have try all the solutions mentioned above, and the issue still occurs. |
if u are facing issue in Package manager console, try using dotnet cli with the following commands: |
Moved from dotnet/EntityFramework.Docs#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:
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.
The text was updated successfully, but these errors were encountered: