Solution
I solved this error by rechecking the the following points
1) The Microsoft.EntityrameworkCore.Design is installed in to the project
The Microsoft.EntityrameworkCore.Design package has to be installed in to the project as shown in the below image
2) Select the correct Default project in package manager console window
Select the correct project window where database Context class is present, here in the below example
public class InCompareContext : DbContext{}
Summary
I solved the error by selecting the correct Default project where the Entity framework tools are installed.