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
Regular Expressions in C#: Complete Guide with Examples
Dependency Injection in Go: for Beginners — Examples and Principles
Reflection and Introspection in C#: How to Look Inside Your Code
Create a folder in PHP if it doesn't exist: 5 best ways in 2025