-
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
.NET Core CLI commands fail when wrong imports were used for first run of dotnet-restore #5458
Comments
Can you include your |
I posted a question on Stack Overflow. It's not the complete |
Can you try adding |
I tried adding |
What happens if you add both? |
When adding 7.0.1, or both 8.0.3 and 7.0.1 I get the following warnings:
The project builds with warnings, but errors when trying to use |
Sorry - I forgot. You have to include |
Bummer. Thought I had a remedy. Still getting the errors with the following:
I have tried variations of the above, but have not solved this riddle. |
@mhenderson442 just in case it helps, what NuGet feed are you using? Do you have a project.lock.json file? |
I am using nuget.org(https://api.nuget.org/v3/index.json). I do have a project.lock.json. There are two references to Newtonsoft.Json 7.0.1. Excerpted below.
|
If it's useful, here are some the steps I follow trying to solve the issue:
At this point I get the error you see at the start of this thread. |
Unfortunately I think we are hitting #5320. |
#5320 does look quite similar. I used the Web Api template to create the project. I even tried a Web Application template to see if something was not right with the template. |
@natemcmaster do you think this in fact may be a dupe of #5320? |
Depends. Is emitEntryPoint set to true? Also, what is the output when adding --verbose? |
emitEntryPoint is set to true.
Here is the output when running Scaffold-DbContext with verbose:
|
@mhenderson442 thanks for that. I suspect this is related to imports. Try this to fix it
Preview 1 "tools": {
"Microsoft.EntityFrameworkCore.Tools": {
"version": "1.0.0-preview1-final",
"imports": "portable-net451+win8"
} Preview 2 "tools": {
"Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final"
} cref https://docs.efproject.net/en/latest/miscellaneous/cli/dotnet.html |
@natemcmaster Following your instructions, Using Package Manager Console I got the following error:
Got the following error: I am connecting to a SQL Azure database. Is this supported? |
👍 glad we got the first error out of the way.
Yes, can you open another issue? We support querying from SQL Azure, but I don't think we have ever testing scaffolding from a SQL Azure database. cc @lajones This can probably be closed now. For anyone else who encounters this (cc @Kurira), the "Newtonsoft.Json" error is likely due to NuGet caching issues. Clear your caches as instructed above #5458 (comment) |
From my perspective I think this issue is closed. I will tinker some more to make sure the other errors warrant a new issue. @lajones @divega @natemcmaster Thanks for the guidance. |
Hello, I came to a similar problem after fixing EDIT: Occurs when I am trying to execute My project.json
Any ideas? |
@ole1986 as the issue describes, your imports are incorrect. For preview1, use "portable-net451+win8" See #5458 (comment) |
Updated my Visual Studio with RC 2 and created a Web API project.
Followed documentation guidelines for new application with existing database.
The following error was thrown hitting Scaffold-DbContext.
Got a similiar Newtonsoft related error using CLI
dotnet ef
.The text was updated successfully, but these errors were encountered: