首页 文章

System.InvalidOperationException:找不到编译器可执行文件csc.exe

提问于
浏览
1

我在.NET 4.0框架中有一个应用程序 .

此应用程序在安装了.NET framework 4.0的服务器上运行正常(此计算机上也安装了所有以前的版本(3.5 sp1,3.0,2.0)) . 出于某种原因,我们必须将此应用程序移动到另一台仅安装了.NET framework 4.5.2的服务器上 . 因此,当我们访问它时将应用程序移动到这个新服务器后,我们就会收到以下错误消息:

找不到编译器可执行文件csc.exe . 异常详细信息:System.InvalidOperationException:找不到编译器可执行文件csc.exe .

我无法确定导致此问题的原因 . 请建议 .

这是完整的堆栈跟踪:

[InvalidOperationException: Compiler executable file csc.exe cannot be found.]
   System.CodeDom.Compiler.RedistVersionInfo.GetCompilerPath(IDictionary`2 provOptions, String compilerExecutable) +8338603
   Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +739
   Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames) +170
   System.Web.Compilation.AssemblyBuilder.Compile() +12114384
   System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +301
   System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp) +12653841
   System.Web.Compilation.BuildManager.CompileGlobalAsax() +50
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +665

[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
   System.Web.Compilation.BuildManager.ReportTopLevelCompilationException() +80
   System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled() +1142
   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +1193

[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +12656404
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +159
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +12496021

1 回答

  • 0

    我在Windows应用程序中也面临同样的问题,我只是简单地重新安装了Dot net框架,它对我有用 .

相关问题