Windows Server 2008 R2:找不到编译器可执行文件csc.exe

时间:2013-06-05 12:21:13

标签: asp.net asp.net-mvc-3 .net-4.0 windows-server-2008-r2

我的应用程序正在运行:

  • ASP.NET
  • MVC 3
  • Framework 4.0

当我在我的计算机上运行该应用程序(localhost:...)时,它已成功运行 现在,这是我第一次在Windows Server 2008 R-2上运行应用程序 错误是:“无法找到编译器可执行文件csc.exe”
可能是什么问题?

(。net4安装正确,csc.exe文件存在于:“C:\ Windows \ Microsoft.NET \ Framework \ v4.0 \”)。

1 个答案:

答案 0 :(得分:-1)

请发送完整的堆栈跟踪,如下所示

"[InvalidOperationException: Compiler executable file csc.exe cannot be found.]
   System.CodeDom.Compiler.RedistVersionInfo.GetCompilerPath(IDictionary`2 provOptions, String compilerExecutable) +8675071
   Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames) +739
   Microsoft.CSharp.CSharpCodeGenerator.FromSourceBatch(CompilerParameters options, String[] sources) +3293761
   Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromSourceBatch(CompilerParameters options, String[] sources) +64
   HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.Compile(String fileName, String[] sources, IEnumerable`1 assembliesToReference) +1252
   HibernatingRhinos.Profiler.Appender.Util.GenerateAssembly.CompileAssembly(IEnumerable`1 sourcesResources, IEnumerable`1 assembliesToReference, String assemblyName) +118
   HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupDatabaseDefaultConnectionFactoryIfNeeded() +929
   HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.SetupEntityFrameworkIntegration() +80
   HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize(EntityFrameworkAppenderConfiguration configuration) +47
   HibernatingRhinos.Profiler.Appender.EntityFramework.EntityFrameworkProfiler.Initialize() +73
   Web4.MvcApplication.Application_Start() +17

[HttpException (0x80004005): Compiler executable file csc.exe cannot be found.]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12864673
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

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

如果您使用的是HibernatingRhinos,则应尝试新的dll版本: http://hibernatingrhinos.com/builds就像在这篇文章中讨论的那样: https://groups.google.com/forum/#!topic/nhprof/XY4e3tm-ONc 它解决了我的问题。