博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WCF, the Service attribute value in the ServiceHost directive could not be found.
阅读量:6273 次
发布时间:2019-06-22

本文共 2926 字,大约阅读时间需要 9 分钟。

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即没有去添加。

 

解决问题:

 

 

转载地址:http://bngpa.baihongyu.com/

你可能感兴趣的文章
网络编程懒人入门(九):通俗讲解,有了IP地址,为何还要用MAC地址?
查看>>
第三章 导数与微分
查看>>
WPF编游戏系列 之二 图标效果
查看>>
设计模式-里氏替换原则
查看>>
react-native调试
查看>>
基于Excel2013的合并计算
查看>>
Qt学习笔记(二)-常用快捷键
查看>>
RStudio v1.2.1335 发布,R 语言的集成开发环境
查看>>
NutzWk 5.2.2 发布,Java 微服务分布式开发框架
查看>>
mybatis 自动生成代码(mybatis generator)
查看>>
Confluence 6 当前使用的数据库状态
查看>>
dll文件32位64位检测工具以及Windows文件夹SysWow64的坑
查看>>
趣谈网络协议-笔记(1)
查看>>
【转载】Nginx负载均衡配置简单配置方法
查看>>
Python 文件读取的不同方法比对
查看>>
01 pandas 简介
查看>>
正则去除html字符串中的注释、标签、属性
查看>>
poj-3094-quicksum
查看>>
手写 reactor( netty reactor 模型)
查看>>
【Android 进阶】仿抖音系列之翻页上下滑切换视频(一)
查看>>