'Error MSB4024: The imported project file ".csproj.EntityFrameworkCore.targets" could not be loaded

I have a .NET Core / Angular project and it was work fine. But when I try to run dotnet ef migration add command, it failed to build and generates this error.

C:\Program Files\dotnet\sdk\3.1.101\Microsoft.Common.targets(127,3): error MSB4024: The imported project file "D:\BusinessProjects\Repo\badessaSoftware\obj\badessaSoftware.csproj.EntityFrameworkCore.targets" could not be loaded. Unexpected end tag. Line 26, position 6. [D:\stockmanagement.csproj]

Please help me.



Solution 1:[1]

After a time, I get the problem. The problem was because I added omnisharp.json file to root of my project with content:

{ "MSBuild": { "UseLegacySdkResolver": true } }

to solve the problem with omnisharp.after I remove this file it worked.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1