title: "ServiceHost only supports class service types"
body: <p>For some reason I can't get past this error. I've done searching, but can't find any vb examples. What am I doing wrong with this web.config?  </p>
  
  <p><strong>SalesTracking.svc</strong></p>
  
  <pre><code>&lt;%@ ServiceHost Language="VB" Debug="true" Service="SalesTracking.ISalesTracking" CodeBehind="SalesTracking.svc.vb" %&gt;
  </code></pre>
  
  <p><strong>SalesTracking.svc.vb</strong></p>
  
  <pre><code>Imports GlobalDir
  Imports System.Web.Script.Serialization
  Imports System.Reflection
  Imports System.Data.SqlClient
  Imports System.Web.Configuration
  Imports System.Threading
  Imports System.ServiceModel.Activation
  
  
  &lt;AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)&gt; _
  Public Class WebService
     Implements ISalesTracking
  
  
  
     Public Function GetDataUsingDataContract(ByVal composite As ClientSideData) As ClientSideData Implements ISalesTracking.GetDataUsingDataContract
  
     End Function
  End Class
  </code></pre>
  
  <p><strong>Web.config</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
      &lt;appSettings/&gt;
      &lt;connectionStrings&gt;
          &lt;add name="dbconstring" connectionString="Data Source="" providerName="System.Data.SqlClient" /&gt;
      &lt;/connectionStrings&gt;
    &lt;system.web&gt;
        &lt;authentication mode="Windows" /&gt;
        &lt;authorization&gt;
  
            &lt;allow roles="Domain Users" /&gt;
            &lt;deny users="*" /&gt;
        &lt;/authorization&gt;
            &lt;customErrors mode="Off"/&gt;
  
        &lt;compilation debug="true" strict="false" explicit="true" targetFramework="4.0" /&gt;
  
    &lt;/system.web&gt;
    &lt;system.serviceModel&gt;
        &lt;behaviors&gt;
            &lt;serviceBehaviors&gt;
                &lt;behavior name="SalesTracking.WebServiceBehavior"&gt;
                    &lt;!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --&gt;
                    &lt;serviceMetadata httpGetEnabled="true"/&gt;
                    &lt;!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information --&gt;
                    &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
                &lt;/behavior&gt;
            &lt;/serviceBehaviors&gt;
  
            &lt;!-- start addition --&gt;
            &lt;endpointBehaviors&gt;
                &lt;behavior name="ServiceAspNetAjaxBehavior" &gt;
                    &lt;enableWebScript/&gt;
                &lt;/behavior&gt;
            &lt;/endpointBehaviors&gt;
            &lt;!-- end addition --&gt;
  
        &lt;/behaviors&gt;
      &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
        &lt;services&gt;
            &lt;service behaviorConfiguration="SalesTracking.WebServiceBehavior"
              name="SalesTracking.WebService" &gt;
  
                &lt;endpoint address="localhost" behaviorConfiguration="ServiceAspNetAjaxBehavior"
                  binding="webHttpBinding" bindingConfiguration="NewBinding0" name="SalesTracking.WebService"
                  contract="SalesTracking.ISalesTracking"&gt;
                &lt;/endpoint&gt;
                &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
            &lt;/service&gt;
        &lt;/services&gt;
  
    &lt;/system.serviceModel&gt;
    &lt;system.webServer&gt;
      &lt;modules runAllManagedModulesForAllRequests="true"/&gt;
    &lt;/system.webServer&gt;
  
  &lt;/configuration&gt;
  </code></pre>