Roslyn Issue with ASP .NET Core

0

When I run my ASP .NET Core app I get the following error. Can anybody help me solve this?

Server Error in '/' Application.
Could not find a part of the path 'D:\Program Files\FeaziApi\FeaziApi\FeaziApi\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 'D:\Program Files\FeaziApi\FeaziApi\FeaziApi\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 'D:\Program Files\FeaziApi\FeaziApi\FeaziApi\bin\roslyn\csc.exe'.]
       System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) +373
       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) +738
       System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share) +68
       Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.get_CompilerName() +91
       Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.FromFileBatch(CompilerParameters options, String[] fileNames) +658
       Microsoft.CodeDom.Providers.DotNetCompilerPlatform.Compiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +186
       System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames) +25
       System.Web.Compilation.AssemblyBuilder.Compile() +985
       System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +10223794
       System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +10113866
       System.Web.Compilation.BuildManager.CompileGlobalAsax() +47
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +274
    
    [HttpException (0x80004005): Could not find a part of the path 'D:\Program Files\FeaziApi\FeaziApi\FeaziApi\bin\roslyn\csc.exe'.]
       System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +65
       System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +458
       System.Web.Compilation.BuildManager.CallAppInitializeMethod() +35
       System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +605
    
    [HttpException (0x80004005): Could not find a part of the path 'D:\Program Files\FeaziApi\FeaziApi\FeaziApi\bin\roslyn\csc.exe'.]
       System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +10080656
       System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +99
       System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +263

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4075.0
asp.net-core
roslyn
asked on Stack Overflow Jul 6, 2020 by Anas Khan • edited Jul 7, 2020 by bad_coder

2 Answers

0

you have to upload the "roslyn" folder and its files as well so "bin\roslyn" should be on the server

answered on Stack Overflow Jul 7, 2020 by okarpov
0

Try "Clean Solution" and then "Rebuild All". I had this happen to me with a tutorial I downloaded.

answered on Stack Overflow Apr 7, 2021 by Bret W

User contributions licensed under CC BY-SA 3.0