asp.net - 找不到 Windows Server 2008 R2 : Compiler executable file csc. exe

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

我的应用程序正在运行:

  • ASP.NET
  • MVC 3
  • 框架 4.0

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

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

    最佳答案

    请发送完整的堆栈跟踪,就像下面这样 :

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

    关于asp.net - 找不到 Windows Server 2008 R2 : Compiler executable file csc. exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16939839/

    上一篇:SQL计算总价

    下一篇:java - 可观察超时

    相关文章:

    javascript - 从多个 TreeView 中获取所有子节点的 ID(跳过父节点 ID)。如何?

    asp.net - ASP.NET 页面可以像仅使用 HTML 完成的页面一样为 "lively"吗?

    c# - 如何在 ASP.NET Core 2.0 Controller 上同时拥有 'get by id' 和 'get by name' 路由?

    jquery - 为什么 ('#formId' ).trigger ('submit' ) 会导致我的表单多次发布,而 ('formId' ).trigger ('submit' ) 不会?

    c# - Dynamics CRM 2011 - LINQ - 检索客户和联系人之间的连接

    c# - 当类的任何属性发生变化时调用 setter

    c# - 转储文件时 Iframe onLoad 不会触发?

    asp.net - 使用 ASP.NET MVC 进行模型绑定(bind)内部嵌套模型

    c# - 在 ASP.NET MVC 中执行异步操作使用来自 .NET 4 上的 ThreadPool 的线程

    c# - 在没有文件下载对话框的情况下在 WebBrowser 控件中打开 office 文档?