Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

.net

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.

like image 420
abdella Avatar asked Sep 17 '25 11:09

abdella


2 Answers

What worked for me was deleting the bin and obj folders and then rebuilding the project as per Rousta's suggestion.

like image 127
Gift Ntokozo Mavuso Avatar answered Sep 23 '25 05:09

Gift Ntokozo Mavuso


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 removed this file it worked.

like image 27
abdella Avatar answered Sep 23 '25 06:09

abdella



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!