Resolving the "Could Not Find a Part of the Path ... binroslyncsc.exe" Error in ASP.NET MVC
When encountering the error "Could not find a part of the path 'C:B8akWorkspaceB8akProjectB8akSolutionB8AK.Portalbinroslyncsc.exe'" while running an ASP.NET MVC project from TFS, it indicates a problem with finding the .NET compiler.
Understanding the Error
Despite successful build and compilation without errors, the error suggests that the build process is unable to locate the Roslyn compiler executable at the specified path. Roslyn is a .NET compiler platform that provides advanced compiling capabilities. However, it is not a necessary requirement for running ASP.NET MVC projects.
Solution: Updating NuGet Packages
The most effective solution to this issue is to update the NuGet package Microsoft.CodeDom.Providers.DotNetCompilerPlatform. Open the Package Manager Console and execute the following command:
Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r
Explanation
The Roslyn compiler is installed as a NuGet package. Bugs in earlier package versions may have caused this error. Updating to a more recent version usually resolves these issues.
Additional Notes
It's important to note that this problem is not related to Visual Studio. Workarounds such as adding build steps to copy files over or manually adding compiler binaries are not recommended. Ensuring the correct paths to NuGet packages in the .csproj file, particularly within the
The above is the detailed content of Why Can't My ASP.NET MVC Project Find 'csc.exe' and How Do I Fix It?. For more information, please follow other related articles on the PHP Chinese website!