Find missing dependencies using dotnet command on Linux

If you have a large C# project with a lot of error messages and you want to identify what dependencies are missing without the need of any fancy tool, you can use the following command:

dotnet build | grep ' Unable to find package ' | sed -E 's/.*Unable to find package ([A-Za-z\.][A-Za-z\.]*) .*/\1/' | sort | uniq

It will output a simple list of the missing packages in order directly, one package per line. It will not solve your problems with the missing dependencies but will help you to, at least, identify what is missing.

Tags: