I had this issue on the server I was deploying to, and determined that I did not need
Microsoft.CodeDom.Providers.DotNetCompilerPlatform
So, I uninstalled it via nuget, and removed the reference in the web config. No more issues.
I originally tried to added target node to the .proj file as mentioned in some of the other answers, but that just lead to another error where the msbuild
could not copy the pagefile.sys
which seemed from what I read to be a bug in the nuget package.