zoukankan      html  css  js  c++  java
  • WCF, the Service attribute value in the ServiceHost directive could not be found.

    Server Error in '/InsusSiteCS' Application.


    The type 'Catalog', 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.             Exception Details: System.InvalidOperationException: The type 'Catalog', provided as the Service attribute value in the ServiceHost directive, or provided in the configuration element system.serviceModel/serviceHostingEnvironment/serviceActivations could not be found. Source Error:

    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.                  

    Stack Trace:

    [InvalidOperationException: The type 'Catalog', 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) +59638
       System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +1434
       System.ServiceModel.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity) +52
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity) +598
    
    [ServiceActivationException: The service '/InsusSiteCS/WCF/Catalog.svc' cannot be activated due to an exception during compilation.  The exception message is: The type 'Catalog', 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) +495736
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +178
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +229
       System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +24
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69
    
                      

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18010

    Insus.NET有写一个WCF Service ,在测试时,出现如上错误。

    经过仔细检查与debug,才发现原来是因为在建立Service时,自己添加上命名空间,而在.svc即没有去添加。

    解决问题:

  • 相关阅读:
    Linux 为linux enterprises 6安装图形桌面教程
    loadrunner 结果分析-loadrunner结果分析
    python 全栈开发,Day91(Vue实例的生命周期,组件间通信之中央事件总线bus,Vue Router,vue-cli 工具)
    python 全栈开发,Day90(Vue组件,前端开发工具包)
    python 全栈开发,Day89(sorted面试题,Pycharm配置支持vue语法,Vue基础语法,小清单练习)
    python 全栈开发,Day88(csrf_exempt,ES6 快速入门,Vue)
    python 全栈开发,Day87(ajax登录示例,CSRF跨站请求伪造,Django的中间件,自定义分页)
    python 全栈开发,Day85(Git补充,随机生成图片验证码)
    python 全栈开发,Day84(django请求生命周期,FBV和CBV,ORM拾遗,Git)
    python 全栈开发,Day83(博客系统子评论,后台管理,富文本编辑器kindeditor,bs4模块)
  • 原文地址:https://www.cnblogs.com/insus/p/2867629.html
Copyright © 2011-2022 走看看