Could not find a part of the path 'roslyn/csc.exe' in Asp.Net Mvc

Dung Do Tien Aug 27 2021 178

Hello you guys. I have a project long time to develop with Asp.Net  MVC Framework version 4.5. It still works fine but today I run and got an error DirectoryNotFoundException: Could not find a part of the path '..\bin\roslyn\csc.exe'.

[DirectoryNotFoundException: Could not find a part of the path 'E:\Project\Philip\Main\Source_New\Admin\Source\admin\DVG.APA.CMSApi\bin\roslyn\csc.exe'.]
   System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +281
   System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) +1242
   System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +126
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName() +130
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +828
   Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +185
   System.Web.Compilation.AssemblyBuilder.Compile() +2032
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +357
   System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +12033309
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +52
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +341

What's that mean? Anybody can explain it to me?

I tried to clear and rebuild much time but it still does not work for me.

Thanks for any suggestions.

Have 1 answer(s) found.
  • S

    Samuel Kiseve Aug 27 2021

    Guide to way help solve the error: Could not find a part of the path … bin\roslyn\csc.exe

    Step 1: Open NuGet Package Console window of Visual Studio

    Step 2: Uninstall two packages

    PM> Uninstall-package Microsoft.CodeDom.Providers.DotNetCompilerPlatform

    PM> Uninstall-package Microsoft.Net.Compilers

    Hope this helps.

Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close