Notification texts go here Contact Us Buy Now!

Dotnet 6 dotnet-ef fails after install

Following this documentation I was able to get everything working successfully.

Do the following:

Remove all .NET packages

sudo apt remove dotnet* sudo apt remove aspnetcore*

Delete PMC repository from APT, using any of the typical methods, for instance by deleting the repo .list file

sudo rm /etc/apt/sources.list.d/microsoft-prod.list

Update APT

sudo apt update

Install .NET SDK 6.0

sudo apt install dotnet-sdk-6.0

I'm guessing something installed incorrectly from the first time I attempted the install leaving everything in that Mixed state scenario 1

I had the same issue and discovered in the dotnet --info that the path to the dotnet executable was wrong; also the DOTNET_ROOT was wrong.

So there are two more useful commands:

 dotnet --list-runtimes 
 dotnet --info

I found the answer on another question

In short, add a DOTNET_ROOT variable to your environment. For me, I used the .NET scripted installer and added this to ~/.bashrc:

export DOTNET_ROOT=~/.dotnet

I was on macOS and got this error while running dotnet ef add migration.

The solution for me was install the given .NET Runtime in the error message itself, using the link provided.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.