WCF Debug Exception information: ServiceHost only supports class service types

Source: Internet
Author: User

Server error in the "/commonhelpservices" application.

ServiceHost only supports class service types.

Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.

Exception Details: System.ArgumentException:ServiceHost only supports class service types.

SOURCE Error:

An unhandled exception was generated during the execution of the current WEB request. You can use the following exception stack trace information to determine information about the cause of the exception and where it occurred.

Stack trace:


[Argumentexception:servicehost supports only class service types. ]
System.ServiceModel.Description.ServiceDescription.GetService (Type servicetype) +12392423
System.ServiceModel.ServiceHost.CreateDescription (IDictionary ' 2& implementedcontracts) +55
System.ServiceModel.ServiceHostBase.InitializeDescription (urischemekeyedcollection baseaddresses) +154
System.ServiceModel.ServiceHost.InitializeDescription (Type servicetype, urischemekeyedcollection baseaddresses) + 49
System.ServiceModel.ServiceHost. ctor (Type servicetype, uri[] baseaddresses) +151
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost (Type servicetype, uri[] baseaddresses) +30
System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost (String constructorstring, uri[] baseaddresses ) +422
System.ServiceModel.HostingManager.CreateService (String Normalizedvirtualpath) +1461
System.ServiceModel.HostingManager.ActivateService (String Normalizedvirtualpath) +44
System.ServiceModel.HostingManager.EnsureServiceAvailable (String Normalizedvirtualpath) +651


[ServiceActivationException: The Service "/COMMONHELPSERVICES/DESIGNTIMESERVICE.SVC" could not be activated due to an exception during compilation.) The exception message is: ServiceHost only supports class service types. ]
System.Runtime.AsyncResult.End (IAsyncResult result) +688334
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End (IAsyncResult result) +190
System.ServiceModel.Activation.ServiceHttpModule.EndProcessRequest (IAsyncResult ar) +304886

System.Web.AsyncEventExecutionStep.OnAsyncEventCompletion (IAsyncResult ar) +94


Debugging WCF today, there is a strange phenomenon is to browse the. svc file when the above error occurred, when the client calls the function, there is a function in the "Object Browser View" is there, but in other projects through the client class instance referencing the function, it is not really found, There is no problem with the implementation of the WCF interface and the corresponding class.

Baidu has made a lot of information, but also wood to find a viable solution, finally delete the SVC and its corresponding interface, re-added a WCF service, and then put the previous SVC and interface code copied over, done!

Always wood has found the reason, hope to know people, leave a message.


WCF Debug Exception information: ServiceHost only supports class service types

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.