Tasks Targets Not Importing

Losing my mind here. My project started throwing this error message. Even restored the project from a backup made a few hours ago and even a backup made several months ago and the error is still being thrown. If I start a new project the error is no longer present.

Severity Code Description Project File Line Suppression State
Error Project C:\Users\XXXXX.nuget\packages\monogame.content.builder.task\\build\MonoGame.Content.Builder.Task.targets was not imported by C:\Users\XXXXX\Desktop\JPSystem\JPSystem\JPSystem\JPSystem\obj\JPSystem.csproj.nuget.g.targets at (5,5), due to the file being invalid. JPSystem C:\Users\XXXXX.nuget\packages\monogame.content.builder.task\\build\MonoGame.Content.Builder.Task.targets 5

Also where you see XXXXX is my username and it doesn’t contain spaces.

Did you try deleting the obj folder?

Otherwise you could try going to C:\Users\XXXXX\.nuget\packages\monogame.content.builder.task\ and deleting the\ folder. Then you do a:

dotnet restore
1 Like

Looks like doing those steps fixed the issue. Thankyou for the quick response.

1 Like