【发布时间】:2011-05-05 11:55:53
【问题描述】:
我将按照以下步骤逐步完成到目前为止所做的事情:
- 创建了空解决方案
- 添加了网站 WCFService
- 从网站上删除了 Service 和 IService
- 向解决方案添加了 WCF 服务库项目
- 为 web.config 添加了端点
- 在 app.config 中做了同样的事情
- 在 Web 应用程序中添加了对服务库的引用
- ctrl + F5 9
我收到以下错误:
“/WFLedger”中的服务器错误 应用。方式 'Services.WFLedger.WF_Ledger', 作为服务属性提供 ServiceHost 指令中的值,或 在配置元素中提供 system.serviceModel/serviceHostingEnvironment/serviceActivations 找不到。说明:一个 期间发生未处理的异常 当前网络的执行 要求。请查看堆栈跟踪 有关错误的更多信息 以及它起源于代码的位置。
异常详情:
System.InvalidOperationException: 类型 'Services.WFLedger.WF_API_Ledger', 作为服务属性提供 ServiceHost 指令中的值,或 在配置元素中提供 system.serviceModel/serviceHostingEnvironment/serviceActivations 找不到。
来源错误:
产生了一个未处理的异常 在当前执行期间 网络请求。有关的信息 异常的起源和位置 可以使用异常识别 下面的堆栈跟踪。
堆栈跟踪:
[InvalidOperationException:类型 'Services.WFLedger.WF_Ledger', 作为服务属性提供 ServiceHost 指令中的值,或 在配置元素中提供 system.serviceModel/serviceHostingEnvironment/serviceActivations 找不到。]
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(字符串 构造函数字符串,Uri[] 基本地址)+654
System.ServiceModel.HostingManager.CreateService(字符串 标准化虚拟路径)+1439
System.ServiceModel.HostingManager.ActivateService(字符串 normalizedVirtualPath) +45
System.ServiceModel.HostingManager.EnsureServiceAvailable(字符串 normalizedVirtualPath) +647[服务激活异常: 服务'/WFLedger/WF_Ledger.svc' 无法激活,因为 编译时出现异常。这 异常消息是:类型 'Services.WFAPILedger.WF_API_Ledger', 作为服务属性提供 ServiceHost 指令中的值,或 在配置元素中提供 system.serviceModel/serviceHostingEnvironment/serviceActivations 找不到..]
System.Runtime.AsyncResult.End(IAsyncResult 结果)+437
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult 结果)+188
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication 上下文,字符串 routeServiceVirtualPath,布尔值 flowContext,布尔确保WFService) +230 System.ServiceModel.Activation.HttpModule.ProcessRequest(对象 发件人,EventArgs e) +360 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean & completedSynchronously) +76
这真的让我发疯了!!! 为什么我会收到此错误? 如果您需要更多信息,请告诉我,以便我提供给您 提前一百万谢谢
【问题讨论】: