This error crops up every once in awhile when swapping projects. This stack overflow has a good overview / solution SO Link; the answer with the most votes, not the accepted answer.
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r