4

我的应用程序通过以下方式运行:

  • ASP.NET
  • MVC 3
  • 框架 4.0

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

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

4

1 回答 1

-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 它解决了我的问题。

于 2013-07-10T04:16:51.677 回答