rider-efcore icon indicating copy to clipboard operation
rider-efcore copied to clipboard

Cannot start migrations

Open anime-shed opened this issue 9 months ago • 9 comments

Describe the bug

I am unable to execute the dotnet-ef using the GUI available in Rider; instead, it shows an error that dotnet-ef is not found, and when I try to fix it, it presents me with Tool 'dotnet-ef' is already installed. I also verified it from a terminal and also was able to run migrations via cli.

To Reproduce

Steps to reproduce the behaviour:

image

Expected behaviour

A window should open with other options to proceed

Screenshots

image image image

Environment (please complete the following information):

  • OS: Windows
  • .NET SDK info (installed ones and versions used within Rider): 8.0, 6.0
  • Plugin version: 232.1.0
  • Rider version: 2023.2.1

anime-shed avatar Sep 16 '23 14:09 anime-shed

Hi @anime-shed, on which level dotnet ef tools are installed? As a local tool on the solution level or as a global tool?

seclerp avatar Sep 17 '23 19:09 seclerp

And does restarting Rider fix the issue?

seclerp avatar Sep 17 '23 19:09 seclerp

@seclerp It is installed on the Global level and local level for some projects.

And restarting Rider did not solve it.

anime-shed avatar Sep 18 '23 04:09 anime-shed

same issue with EF core tools, with rider 2023.2.3, .NET6, macos sonoma, plugin EntityFrameWork Core UI 232.1.0, the plugin try to install v8.0.0 from EF Core and isn't compatible with .NET6 Screenshot 2023-11-17 at 11 50 29 Any news about this bug ?

roberto-sotar avatar Nov 17 '23 14:11 roberto-sotar

@roberto-sotar Currently there is no way of installing a specific dotnet ef tools version using "Install" action. The plugin always installs the latest stable version globally it it isn't already installed (quite oftenly, they are backward compatible). Because of that we can't rely on specific EF Core version of your solution (global tools are installed in per-machine basis).

So you have 2 options here:

  1. Install EF Core Tools globally with a specific version: dotnet tool install --global dotnet-ef --version 6.0.25
  2. Install EF Core Tools locally inside solution folder dotnet tool install dotnet-ef --version 6.0.25

    In case you don't have a tool manifest file run dotnet new tool-manifest before installing tools locally

After installation, the EF Core UI plugin will acknowledge installed tools and you'll be able to perform migrations.

Please note, sometimes Rider doesn't see tools installed right after installation. It's a known issue and is already addressed in the upcoming 2023.3 release.

seclerp avatar Nov 18 '23 22:11 seclerp

@seclerp hello! I have a question related to local dotnet tools. I have several projects with EF Core, but with different versions. Each project has specific dotnet tools. How can I switch to local dotnet tools instead of the global version?

my-dev-92 avatar Dec 14 '23 12:12 my-dev-92

Hi @my-dev-92, currently you can use one of 2 options:

  • Globally installed tools (e.g. dotnet tool install --global, Rider installs tools this way when you do it using the "Install" action)
  • Locally installed in Solution (e.g. dotnet tool install on Solution level with Solution level tool manifest)

So Project-level tools are not supported yet. Please open a ticket on YouTrack but no ETA for now.

seclerp avatar Dec 14 '23 14:12 seclerp

Hi @my-dev-92, currently you can use one of 2 options:

  • Globally installed tools (e.g. dotnet tool install --global, Rider installs tools this way when you do it using the "Install" action)
  • Locally installed in Solution (e.g. dotnet tool install on Solution level with Solution level tool manifest)

So Project-level tools are not supported yet. Please open a ticket on YouTrack but no ETA for now.

Sorry, I meant solutions instead of projects. E.g. Solution1 has a project with EF Core 6.x.x version and Solution2 has a project with EF Core 7.x.x version. And each of the solutions has a tool manifest file dotnet-tools.json. I thought that locally installed in Solution was used in EF Core UI. But I see the following: image

my-dev-92 avatar Dec 15 '23 11:12 my-dev-92

@my-dev-92 could you please provide more details about your Solution's folder structure?

seclerp avatar Dec 15 '23 13:12 seclerp