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

error NU1202: Package dotnet-ef 3.0.1 is not compatible with netcoreapp3.0 #18977

Closed
yongsauheung opened this issue Nov 19, 2019 · 34 comments
Closed

Comments

@yongsauheung
Copy link

@yongsauheung yongsauheung commented Nov 19, 2019

I'm installing dotnet-ef 3.0.1 on Azure DevOps release pipeline with dotnetcore 3.0; installation fails with incompatibility error.

Steps to reproduce

Run

dotnet tool install --global dotnet-ef --version 3.0.1

Expected

Tool 'dotnet-ef' (version '3.0.1') was successfully installed.

Actual

error NU1202: Package dotnet-ef 3.0.1 is not compatible with netcoreapp3.0 (.NETCoreApp,Version=v3.0) / any. Package dotnet-ef 3.0.1 supports: netcoreapp2.1 (.NETCoreApp,Version=v2.1)

Further technical details

EF Core version: 3.0
dotnet-ef version: 3.0.1

Issue is NOT seen in dotnet-ef version 3.0.0. I'm currently using this version to resolve the issue.

@Nothing-Works

This comment has been minimized.

Copy link

@Nothing-Works Nothing-Works commented Nov 19, 2019

same here, does it mean that dotnet-ef 3.0.1 is for .NET Core 3.1 ?

@misaka4e21

This comment has been minimized.

Copy link

@misaka4e21 misaka4e21 commented Nov 19, 2019

same here, and dotnet tool install --global dotnet-ef --version 3.0.0-* is not affected too.
It seems that the one for .NET Core 3.1 is dotnet-ef 3.1.0.

I think this issue a typo netcoreapp2.1 instead of netcoreapp3.0.

@ffloimair

This comment has been minimized.

Copy link

@ffloimair ffloimair commented Nov 19, 2019

Guess there is a bug that was meant to be netcoreapp >= 2.1 instead of netcoreapp == 2.1.
3.0.0 also shows netcoreapp2.1 as dependency but works as expected

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Nov 19, 2019

@bricelam @Pilchie @dougbu Looks possible from this that the package for dotnet-ef was not built correctly.

@ErikEJ

This comment has been minimized.

Copy link
Contributor

@ErikEJ ErikEJ commented Nov 19, 2019

image

image

@Pilchie

This comment has been minimized.

Copy link
Member

@Pilchie Pilchie commented Nov 20, 2019

I'm assuming we didn't make any changes to dotnet-ef in 3.0.1? Should we just unlist the package and tell people to keep using the 3.0.0 version?

@bricelam

This comment has been minimized.

Copy link
Contributor

@bricelam bricelam commented Nov 20, 2019

I fixed the package in release/3.1 for 3.1.0-preview2, but it looks like it also got broken in release/3.0. I can backport the fix.

@bricelam bricelam self-assigned this Nov 20, 2019
bricelam added a commit to bricelam/EFCore that referenced this issue Nov 20, 2019
Fixes dotnet#18977
@andre-dasilva

This comment has been minimized.

Copy link

@andre-dasilva andre-dasilva commented Nov 20, 2019

Does someone know when this issue will be fixed?

@bricelam

This comment has been minimized.

Copy link
Contributor

@bricelam bricelam commented Nov 20, 2019

@Pilchie Is unlisting enough to prevent dotnet tool install from picking it? I suppose it will be once we ship 3.1.0.

@Pilchie

This comment has been minimized.

Copy link
Member

@Pilchie Pilchie commented Nov 20, 2019

I think it will, but looping in @nguerrera to confirm.

@nguerrera

This comment has been minimized.

Copy link
Member

@nguerrera nguerrera commented Nov 20, 2019

@nguerrera

This comment has been minimized.

Copy link
Member

@nguerrera nguerrera commented Nov 20, 2019

I don’t know so I’ve added Will to confirm

@Kant8

This comment has been minimized.

Copy link

@Kant8 Kant8 commented Nov 20, 2019

Right now without fix in 3.0.1 you cannot run dotnet ef commands when on .net core 3.0.100. You get smth like this
The EF Core tools version '3.0.0' is older than that of the runtime '3.0.1'. Update the tools for the latest features and bug fixes.

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Nov 20, 2019

@bricelam Presumably the workaround for anyone hitting this is to install the 3.0.0 version explicitly?

dotnet tool install --global dotnet-ef --version 3.0.0
@derekforeman

This comment has been minimized.

Copy link

@derekforeman derekforeman commented Nov 20, 2019

I've got 3.0.0 installed and it still errors with.

"The EF Core tools version '3.0.0' is older than that of the runtime '3.0.1'. Update the tools for the latest features and bug fixes."

@wli3

This comment has been minimized.

Copy link

@wli3 wli3 commented Nov 20, 2019

@nkolev92 can unlist stop nuget restore "*" that version? I heard from Gallery folks that unlist only controls nuget.org's search

@dougbu

This comment has been minimized.

Copy link
Contributor

@dougbu dougbu commented Nov 20, 2019

@Kant8 and @derekforeman I have the 3.0.0 version of dotnet-ef installed as well as the 3.0.100 SDK. I'm not seeing the inability to roll forward you describe.

> dotnet --version
3.0.100

> dotnet ef --version
Entity Framework Core .NET Command-line Tools
3.0.0

> dotnet ef migrations list
info: Microsoft.EntityFrameworkCore.Infrastructure[10403]
      Entity Framework Core 3.0.0 initialized 'ApplicationDbContext' using provider 'Microsoft.EntityFrameworkCore.SqlServer' with options: None
00000000000000_CreateIdentitySchema

What's different in your environment?

@joshuasnyder

This comment has been minimized.

Copy link

@joshuasnyder joshuasnyder commented Nov 20, 2019

When taking ajcvickers recommendation to explicitly install 3.0.0, I no longer receive the error message.

@Pilchie

This comment has been minimized.

Copy link
Member

@Pilchie Pilchie commented Nov 20, 2019

Tagging @JunTaoLuo who was interested in this.

@nkolev92

This comment has been minimized.

Copy link

@nkolev92 nkolev92 commented Nov 20, 2019

@nkolev92 can unlist stop nuget restore "*" that version? I heard from Gallery folks that unlist only controls nuget.org's search

That is correct, unlist only affects search.

@KbKev78

This comment has been minimized.

Copy link

@KbKev78 KbKev78 commented Nov 21, 2019

In my Azure Devops Pipeline I have a task using EF-Migrations-Script-Generator-Task. This task has a checkbox to install dotnet-ef for Core 3.x projects
image

... but this now fails because it is installing dotnet-ef 3.0.1

I have unchecked that option the added another task before:
image

My Pipeline is now building again. Obviously I'm keen to undo this when the "latest version" option works, but it will suffice for now.

@Kant8

This comment has been minimized.

Copy link

@Kant8 Kant8 commented Nov 21, 2019

@dougbu Completely the same, but I also had Microsoft.EntityFrameworkCore.SqlServer of version 3.0.1. I've downgraded this one too and now everything works perfectly.

@miguellira

This comment has been minimized.

Copy link

@miguellira miguellira commented Nov 21, 2019

I have both the 3.0.100 and 3.0.101 SDKs installed so I pegged my project to the 3.0.100 SDK by placing a global.json file in my root with the following:

{
  "sdk": {
    "version": "3.0.100"
  }
}

and then ran the command @ajcvickers suggested above.

Hopefully 3.1 ships soon so we can forget about 3.0 😃

@ajcvickers ajcvickers added this to the 3.0.2 milestone Nov 22, 2019
@pekspro pekspro mentioned this issue Nov 23, 2019
@lautarogalancid

This comment has been minimized.

Copy link

@lautarogalancid lautarogalancid commented Nov 23, 2019

I don't know why, but specifying a patch number didn't work for me, so i just used:

dotnet tool install --global dotnet-ef --version 3.0

It's working properly now. Hope this helps, until we get the next patch working!

@pekspro

This comment has been minimized.

Copy link

@pekspro pekspro commented Nov 24, 2019

@KbKev78, I’ve updated EF-Migrations-Script-Generator-Task so you are able to specify which version of dotnet-ef to be install. If you enter 3.0.0 you should be fine. I hope this makes the problem easier to deal with until it’s solved.

@KbKev78

This comment has been minimized.

Copy link

@KbKev78 KbKev78 commented Nov 26, 2019

@pekspro,

@KbKev78, I’ve updated EF-Migrations-Script-Generator-Task so you are able to specify which version of dotnet-ef to be install. If you enter 3.0.0 you should be fine. I hope this makes the problem easier to deal with until it’s solved.

Nice job, thanks.
I have now removed that additional step.

Once the underlying issue is resolved I will clear that version number.

Oh, and that's a nice plugin, by the way. Cheers.

bricelam added a commit to bricelam/EFCore that referenced this issue Nov 26, 2019
Fixes dotnet#18977
@bricelam bricelam closed this Nov 26, 2019
@sibeliuz

This comment has been minimized.

Copy link

@sibeliuz sibeliuz commented Nov 28, 2019

I have "dotnet ef" version 3.0.0 installed. Now command "dotnet ef dbcontext scaffold ..." stopped working, giving this message: "The EF Core tools version '3.0.0' is older than that of the runtime '3.0.1'. Update the tools for the latest features and bug fixes." What should i do to fix it? I cannot install "dotnet ef 3.0.1" because of subject error message.

@Kant8

This comment has been minimized.

Copy link

@Kant8 Kant8 commented Nov 28, 2019

@sibeliuz check you do not have any EFCore related dependencies in project of version 3.0.1. You probably have Microsoft.EntityFrameworkCore.Design 3.0.1 (or ...SqlServer, etc.)

@smitpatel

This comment has been minimized.

Copy link
Member

@smitpatel smitpatel commented Dec 5, 2019

The EF Core tools version '3.0.0' is older than that of the runtime '3.0.1'. Update the tools for the latest features and bug fixes.

For me it is just a warning, and command still works after printing it.

@alexandra142

This comment has been minimized.

Copy link

@alexandra142 alexandra142 commented Dec 6, 2019

It is weird,but for me helped add
var connectionString = Configuration.GetConnectionString("IdentityServerConnection");
services.AddDbContext(options => ...
I've used different DbContext here before.

@chungonion

This comment has been minimized.

Copy link

@chungonion chungonion commented Dec 11, 2019

The EF Core tools version '3.0.0' is older than that of the runtime '3.0.1'. Update the tools for the latest features and bug fixes.

For me it is just a warning, and command still works after printing it.

Yes, it turns out it is just a warning and everything functioned as intended for me.

I am not sure whether it is appropriate to make suggestion here, and I found that this message is extremely confusing and lacks of explaination on what's happening underneath. If this message is only intended as a warning message, then at a minimal extent, it should has some sort of hints (i.e. [WARNING]) to tell the user it is a warning indeed,

Thanks!

@ajcvickers

This comment has been minimized.

Copy link
Member

@ajcvickers ajcvickers commented Dec 11, 2019

@chungonion It's not actually even a warning. It's just letting you know that you're not running the latest so you won't be getting the latest features and bug fixes.

@chungonion

This comment has been minimized.

Copy link

@chungonion chungonion commented Dec 12, 2019

@chungonion It's not actually even a warning. It's just letting you know that you're not running the latest so you won't be getting the latest features and bug fixes.

@ajcvickers That's why some sort of indications should be displayed in the terminal

@catalin27es

This comment has been minimized.

Copy link

@catalin27es catalin27es commented Dec 16, 2019

I follow the suggestion from here:
#18977 (comment)
and the error was gone.
Now, I can run the entity framework command line interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.