Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C#

Could not find a part of the path

I am learning ASP.NET MVC FORM class and I use Fitness Frog project in the course. when I press F5 command to debug, I am getting the error to display on Chrome browser. What should I do to solve this problem below? Any help should greatly be appreciated.

Could not find a part of the path 'C:\Users\vince\Source\Repos\vincentnguyen07\FitnessFrog\src\Treehouse.FitnessFrog\bin\roslyn\csc.exe'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\vince\Source\Repos\vincentnguyen07\FitnessFrog\src\Treehouse.FitnessFrog\bin\roslyn\csc.exe'.

Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[DirectoryNotFoundException: Could not find a part of the path 'C:\Users\vince\Source\Repos\vincentnguyen07\FitnessFrog\src\Treehouse.FitnessFrog\bin\roslyn\csc.exe'.] System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +219 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) +776 System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +65 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName() +91 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +656 Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186 System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +24 System.Web.Compilation.AssemblyBuilder.Compile() +950 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +10201809 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +10106756 System.Web.Compilation.BuildManager.CompileGlobalAsax() +44 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +260

[HttpException (0x80004005): Could not find a part of the path 'C:\Users\vince\Source\Repos\vincentnguyen07\FitnessFrog\src\Treehouse.FitnessFrog\bin\roslyn\csc.exe'.] System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +62 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +435 System.Web.Compilation.BuildManager.CallAppInitializeMethod() +33 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +563

[HttpException (0x80004005): Could not find a part of the path 'C:\Users\vince\Source\Repos\vincentnguyen07\FitnessFrog\src\Treehouse.FitnessFrog\bin\roslyn\csc.exe'.] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10075108 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +95 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

3 Answers

Allan Clark
Allan Clark
10,810 Points

Just going on the error, 'Could not find part of path' suggests to me that one of the folders in the given path is missing or misspelled. First I would go into Windows file explorer, start at C: and drill down verifying existence/spelling of each directory.

Thank you Allan

Eric Lepage
Eric Lepage
1,602 Points

Hello,

Did you manage to solve this issue? I have the same error and there are no subfolder roslyn or executable name csc.exe in the zipped project file

Eric Lepage
Eric Lepage
1,602 Points

Hello, Managed to solve the issue by doing this: Tools - Nuget Package Manager - Package Manage Console and execute this commande in the consolde window: Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r