本人才刚刚学习WCF发布到IIS时候出现:

 

无法找到 ServiceHost 指令中作为服务属性值提供的类型“Service.CalculatorService”。

说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。

异常详细信息: System.InvalidOperationException: 无法找到 ServiceHost 指令中作为服务属性值提供的类型“Service.CalculatorService”。

源错误:

执行当前 Web 请求期间生成了未处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。

堆栈跟踪:

[InvalidOperationException: 无法找到 ServiceHost 指令中作为服务属性值提供的类型“Service.CalculatorService”。]
   System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +4073430
   System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +11659180
   System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +42
   System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479

[ServiceActivationException: 由于编译过程中出现异常,无法激活服务“/Service/CalculatorService.svc”。异常消息为: 无法找到 ServiceHost 指令中作为服务属性值提供的类型“Service.CalculatorService”。。]
   System.ServiceModel.AsyncResult.End(IAsyncResult result) +11530250
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
   System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
   System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +278
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

相关文章:

  • 2021-10-04
  • 2021-08-19
  • 2021-05-22
  • 2022-12-23
  • 2021-09-07
  • 2021-07-10
  • 2021-07-09
  • 2022-02-23
猜你喜欢
  • 2022-12-23
  • 2021-12-24
  • 2021-10-08
  • 2022-12-23
  • 2022-02-11
相关资源
相似解决方案