I just had this problem (and solved it).
What caused the error : when I clicked a .cs to open it (JSON_to_UBL.cs) , VS created a .RESX-file. I don't know why.... but it did (see image below) !
This caused the error : two output file names resolved to the same output path: "obj\Debug\net8.0-windows\Peppol_Communicator.PeppolMain.resources"
I could not find the true reason as there is no link whatever to another file of the same name in the resx. After deletion of JSON_to_UBL.resx the program compiled like a charm as it did before!
I sure would like to know why VS added the .RESX for free after double-clicking a cs.