✅ "Build failed. Fix the compilation errors and try again."
So I started C# just a week ago and I've been struggling with a weird error message whenever I do
dotnet run
in the console. Everything was going just fine as soon as I add the int[] correctAnswers = {2, 2, 1};
to the code. Even after I removed it, the error is still the same... I do have .NET version 8.0 and every needed extension installed so I don't really understand why it's popping out. I've been trying to seek the answer on YouTube or via ChatGPT but they both failed. I'd love some help.
The code:
13 Replies
Works just fine for me:
Weird that it would just randomly break like that
Do you have any other files in the project?
uh
well
obj folder
bin folder
but idk if you mean these
Yeah, that seems just fine
Huh
Try deleting
bin
and obj
, and run dotnet run
again?they just randomly keep getting back
and when I remove obj it needs admin permission to remove it
Sure, they are generated when the project builds
Which is why they're safe to delete, they'll be regenerated anyway
Can't you delete it with admin perms?
i can
Translated:
that comes after
dotnet run
Ah
Could be OneDrive issue
Place the projects literally anywhere but desktop or My Documents
Make a
C:/Projects
folder or some such
Or make it on a different drive if you have itand now it should work?
omg it does!
thank you so much man
Yeah
No problem, anytime :Ok:
i hope you have very good day or night
Likewise