A fix to Roslyn issue when compiling in .NET Code.
Introduction
This is long existing issue, at least since VS 2015. There are two possible fixes, one is updating the Roslyn to make the code work, another one is deleting Roslyn. I prefer the latter and will introduce my solution.
The structure of this article:
- Introduction
- Problem
- Two Possible Fixes
- Update the Roslyn compiler
- Delete the Roslyn compiler
- My Fix
Problem
When running a MVC web application, we got this error message:

Possible Fixes
Search online, we saw two possible solutions in one thread: Could not find a part of the path ... bin\roslyn\csc.exe, the suggestions as below:
Update the Roslyn compiler

Delete the Roslyn compiler,


My Fix
I prefer the latter one. This is my solution:
Search entire solution for Microsoft.CodeDom.Providers.DotNetCompilerPlatform









Join the conversation! Your thoughts help the community grow.