我于2003年创建的ASP.NET/C#项目已经在大学服务器上运行了10多年,但是我刚刚得知服务器崩溃了,他们正在尝试重新设置一切。

他们收到以下错误。

我在底部看到似乎他们已经在Debian机器上安装了Mono。可能是他们安装了Mono,但却忘记了安装C#编译器,或者此消息是否暗示其他错误?

什么可能是此错误的原因和解决方案?

最佳答案

根据Mono中的BuildManager代码:

if (configSection == null)
    config = WebConfigurationManager.GetWebApplicationSection ("system.web/compilation") as CompilationSection;
    else
    config = configSection;

...

if (throwOnMissing)
throw new HttpException (String.Concat ("No compiler for language '", language, "'."));


显然在配置中找不到C#的编译部分。您是否检查过machine.config或web.config?例如

  <system.web>
    <compilation defaultLanguage="C#">
      <compilers>
         You should have a .NET compiler configuration here.
      </compilers>
    </compilation>
  </system.web>


查看this page以获得更多信息。

10-01 23:16
查看更多