Error "Could not find part of path ... bin\\roslyn\\csc.exe" in ASP.NET project
Hello colleagues! I'm new to C# and ASP.NET, working in Visual Studio 2022. Today I encountered a strange error when launching a web application. The project was created as a standard ASP.NET MVC, I added a couple of controllers and views, everything compiled fine. But after I updated several NuGet packages (including Microsoft.CodeDom.Providers.DotNetCompilerPlatform), the project stopped launching. The error appears during the compilation of Razor views directly in the browser. Here is the full text:
```
Could not find a part of the path 'C:\Users\MyName\source\repos\MyProject\MyProject\bin\roslyn\csc.exe'.
```
The call stack indicates that the error occurs in System.IO.__Error.WinIOError. I checked the bin\roslyn folder — it doesn't exist at all. I tried cleaning and rebuilding.
No answers yet.
Log in to leave an answer
Blogs
TypeScript in 2025: Overview of Key Innovations and Features