IIS Error : Service cannot be activated due to an exception during compilation. What is it?

IIS Error : Service cannot be activated due to an exception during compilation. What is it?

WebHost failed to process a request.

Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/14938877 Exception: System.ServiceModel.ServiceActivationException: The service '/xxxx.svc' cannot be activated due to an exception during compilation.

我在 IIS 上有一个 ASP.NET 应用 运行。开发人员创建了与我们已经同名的操作合同。在 VS 中很好。但是,在产品 IIS 上部署时失败。

我的问题 - 它与编译有什么关系?是否有一个有意识的简单解释应用程序在 IIS 中发生了什么(在 post-部署和托管 ASP.NET att 方面)?它编译什么?有什么用?

My question - what it has to do with compilation?

每次您 运行 .net 托管进程时,首先要做的是 .net VM(称为 CLR)将程序集(称为 MSIL)中的代码编译到机器中代码。

因此 IIS 作为托管容器为您提供此服务。

至于您遇到的实际错误,我猜这是由于生产 web.config 文件中的某些内容与开发等效文件不同所致。请 post 你的网络配置的 System.ServiceModel 配置部分,我会看看。