I followed these steps and it worked perfectly
- Delete all the bin and obj folders
- Clean solution and rebuild
- Run this command in powershell
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r
I followed these steps and it worked perfectly
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r