gpt4 book ai didi

wcf - VS2010,WCF 服务无法启动

转载 作者:行者123 更新时间:2023-12-04 00:01:06 25 4
gpt4 key购买 nike

我将逐步完成到目前为止我所做的如下:

  • 创建空解决方案
  • 添加了一个网站 WCFService
  • 从网站
  • 中删除了 Service 和 IService
  • 在解决方案中添加了 WCF 服务库项目
  • 添加端点到 web.config
  • 在 app.config 中做了同样的事情
  • 在 Web 应用程序中添加了对服务库的引用
  • ctrl + F5
    9

  • 我收到以下错误:

    Server Error in '/WFLedger' Application. The type 'Services.WFLedger.WF_Ledger', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.



    异常详情:

    System.InvalidOperationException: The type 'Services.WFLedger.WF_API_Ledger', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.



    源错误:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.



    堆栈跟踪:

    [InvalidOperationException: The type 'Services.WFLedger.WF_Ledger', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found.]
    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses) +654
    System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1439
    System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +45
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +647

    [ServiceActivationException: The service '/WFLedger/WF_Ledger.svc' cannot be activated due to an exception during compilation. The exception message is: The type 'Services.WFAPILedger.WF_API_Ledger', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found..]
    System.Runtime.AsyncResult.End(IAsyncResult result) +437
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +188
    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +230 System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +360
    System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76



    这真的让我发疯!!!
    为什么我收到这个错误?
    如果您需要更多信息,请告诉我,以便我提供给您
    提前一百万感谢

    最佳答案

    查看网站项目中的 WF_Ledger.svc 文件。它应该只包含一行。会有包含“Services.WFAPILedger.WF_API_Ledger”的服务属性。 WCF 正在寻找“Services.WFAPILedger.WF_API_Ledger”类,但没有找到。命名空间和类名需要存在于网站项目中,或者在您尝试设置时作为引用。您需要编辑该 Service 属性以匹配 WCF 服务库项目中的服务实现类。

    关于wcf - VS2010,WCF 服务无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5897250/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com