NOTE: If you are not interested in using Roslyn,follow this answer and remove it
The Roslyn:
Your build is trying to find \bin\roslyn\csc.exe
because the following packages have been added to your project. Just review your packages.config
file, you can have both of them there
Microsoft.CodeDom.Providers.DotNetCompilerPlatformMicrosoft.Net.Compilers
What is Roslyn and Who added them(packages) in the project : If you’re using .net Framework 4.5.2 to create projectsusing VS2015, you might have noticed that the project templates useRoslyn by default. Actually, Roslyn is one of open-sourcecompilers for .NET languages from Microsoft.
Why should we delete Roslyn:If your project has Roslyn references and you are interested to deployit on the server, you will get unwanted errors on the website as manyhosting providers still have not upgraded their servers and hence donot support Roslyn. To resolve this issue, you will need to remove theRoslyn compiler from the project template.
How to remove it:
1.Remove NuGet packages, use the following commands from Nuget Package Console
PM> Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatformPM> Uninstall-package Microsoft.Net.Compilers
2.After you do this, your web.config file should be auto-updated. In case it is not, look for the below code in web.config
file and if it is found, delete this piece of code.
<system.codedom><compilers><compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"></compiler><compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"></compiler></compilers></system.codedom>