天天看点

WCF, the Service attribute value in the ServiceHost directive could not be found.

Server Error in '/InsusSiteCS' Application.

             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:

<col>

​<code>​ 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.​</code>​                  

Stack Trace:

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

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

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

​​

WCF, the Service attribute value in the ServiceHost directive could not be found.

解决问题:

WCF, the Service attribute value in the ServiceHost directive could not be found.