Solution has compiled successfully, but after I added an existing class file to the project, this error appeared:
The specified task executable \"csc.exe\
I uninstalled both Microsoft.CodeDom.Providers.DotNetCompilerPlatform and Microsoft.Net.Compilers and everything now works.
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
Microsoft.Net.Compilers