Skip to content
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

Unable to install dotnet-ef 3.1-preview1 #18723

Closed
MintPlayer opened this issue Nov 2, 2019 · 3 comments
Closed

Unable to install dotnet-ef 3.1-preview1 #18723

MintPlayer opened this issue Nov 2, 2019 · 3 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Milestone

Comments

@MintPlayer
Copy link

MintPlayer commented Nov 2, 2019

I'm trying to use the dotnet ef tool in my database project for ASP.NET Core.

Installed NuGet packages (project):

  • Microsoft.EntityFrameworkCore.SqlServer @ 3.1.0-preview1.19506.2
  • Microsoft.EntityFrameworkCore.Tools @ 3.1.0-preview1.19506.2

When I run a dotnet ef command in my project, I'm getting the following error:

C:\WINDOWS\system32>dotnet --version
3.1.100-preview1-014459

C:\WINDOWS\system32>dotnet ef --version
Could not execute because the specified command or file was not found.
Possible reasons for this include:
  * You misspelled a built-in dotnet command.
  * You intended to execute a .NET Core program, but dotnet-ef does not exist.
  * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

Okay, dotnet-ef is not installed. So let's install it globally (admin cmd):

C:\WINDOWS\system32>dotnet tool install dotnet-ef --global --version="3.1.0-preview1.19506.2"
error NU1202: Package dotnet-ef 3.1.0-preview1.19506.2 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1) / any. Package dotnet-ef 3.1.0-preview1.19506.2 supports: netcoreapp3.1 (.NETCoreApp,Version=v3.1)
The tool package could not be restored.
Tool 'dotnet-ef' failed to install. This failure may have been caused by:

* You are attempting to install a preview release and did not use the --version option to specify the version.
* A package by this name was found, but it was not a .NET Core tool.
* The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
* You mistyped the name of the tool.

For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool

So the response is basically telling me that the tool is not compatible with netcoreapp3.1 and only supports netcoreapp3.1, which doesn't make any sense.

  • Version specified -> check
  • dotnet-ef is a .NET Core tool
  • The `%userprofile%.dotnet\tools folder is definitely on the path variable (User scope). Didn't have to change anything after installation

I picked preview1 since I cannot yet install the preview2 runtime/sdk on my computer.

Further technical details

EF Core version: 3.1.0-preview1.19506.2
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET Core 3.1.0-preview1 (THE ONLY ONE I installed on my fresh installed Windows system, but anyway below a list of all installed runtimes)
Operating system: Windows 10 Home 1903
IDE: Visual Studio 2019 16.4.0 Preview 2.0 (Again no other VS installed)

Installed runtimes:

C:\WINDOWS\system32>dotnet --list-runtimes
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0-preview1.19508.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0-preview1.19506.1 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0-preview1.19506.1 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Is this a bug? Additional info or repository needed?

@ajcvickers
Copy link
Member

@MintPlayer Can you try this with preview 2, which is now on NuGet? We believe the issue has already been fixed.

@bricelam
Copy link
Contributor

bricelam commented Nov 4, 2019

Fixed by #18551

@MintPlayer
Copy link
Author

MintPlayer commented Nov 5, 2019

Done.

  1. Install the preview2 SDK: https://dotnet.microsoft.com/download/thank-you/dotnet-sdk-3.1.100-preview2-windows-x64-installer
  2. Update dotnet ef tool (admin cmd):
PS C:\WINDOWS\system32> dotnet tool update dotnet-ef --global --version="3.1.0-preview2.19525.5"
Tool 'dotnet-ef' was successfully updated from version '3.0.0' to version '3.1.0-preview2.19525.5'.
PM> dotnet ef --version
Entity Framework Core .NET Command-line Tools
3.1.0-preview2.19525.5
  1. dotnet ef migrations add / dotnet ef database update works now

@bricelam bricelam added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Nov 5, 2019
@bricelam bricelam self-assigned this Nov 5, 2019
@bricelam bricelam added this to the 3.1.0-preview2 milestone Nov 5, 2019
@ajcvickers ajcvickers modified the milestones: 3.1.0-preview2, 3.1.0 Dec 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported type-bug
Projects
None yet
Development

No branches or pull requests

2 participants