I have solved it this way.
Go to your project file let's say project/name/bin and delete everything within the bin folder. (this will then give you another error which you can solve this way)
then in your visual studio right click project's References folder, to open NuGet Package Manager.
Go to browse and install "DotNetCompilerPlatform".