title: The type 'RestService.weddingservice', provided as the Service attribute value in the ServiceHost directive could not be found
body: <p>Im trying to create my first WCF restful service. 
  In VS2010 I open weddingservice.svc and then hit F5. A browser opens to <a href="http://localhost:50043/weddingservice.svc" rel="nofollow">http://localhost:50043/weddingservice.svc</a>
  But there, this is the error I get:</p>
  
  <pre><code>Server Error in '/' Application.
  
  The type 'RestService.weddingservice', 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 'RestService.weddingservice', 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 'RestService.weddingservice', 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) +51530
     System.ServiceModel.HostingManager.CreateService(String normalizedVirtualPath) +1461
     System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +44
     System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +651
  
  [ServiceActivationException: The service '/weddingservice.svc' cannot be activated due to an exception during compilation.  The exception message is: The type 'RestService.weddingservice', 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) +688590
     System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +190
     System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, String routeServiceVirtualPath, Boolean flowContext, Boolean ensureWFService) +234
     System.ServiceModel.Activation.HttpModule.ProcessRequest(Object sender, EventArgs e) +359
     System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
     System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously) +75
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
  </code></pre>
  
  <p>Below my code, I hope anyone is able to see what Im doing wrong. Am I not using the correct URI? What did I miss?</p>
  
  <p><strong>weddingservice.svc</strong></p>
  
  <pre><code>&lt;%@ ServiceHost Language="VB" Debug="true" Service="RestService.weddingservice" CodeBehind="weddingservice.svc.vb" %&gt;
  </code></pre>
  
  <p><strong>Iweddingservice.vb</strong></p>
  
  <pre><code>Imports System.ServiceModel
  Imports System.Web
  Imports System.IO
  Imports System.Runtime.Remoting.Activation
  Imports System.Collections.Generic
  
  Namespace RestService
  &lt;ServiceContract()&gt;
  Public Interface Iweddingservice
  
      &lt;OperationContract()&gt; _
  &lt;Web.WebGet(UriTemplate:="job/{name}")&gt; _
      Function DoJob(name As String) As String
  
  End Interface
  End Namespace
  </code></pre>
  
  <p><strong>weddingservice.svc.vb</strong></p>
  
  <pre><code>Imports System.ServiceModel
  Imports System.ServiceModel.Web
  Imports System.IO
  Imports System.ServiceModel.Activation
  Imports System.Web.Script.Serialization
  Imports System.Collections.Generic
  Imports System.Xml
  Imports System.Net
  
  Namespace RestService
      Public Class weddingservice
          Implements Iweddingservice
  
          Public Function DoJob(name As String) As String Implements Iweddingservice.DoJob
              Return String.Format("Hello, {0}", name)
          End Function
      End Class
  End Namespace
  </code></pre>
  
  <p><strong>web.config</strong></p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="true" /&gt;
    &lt;services&gt;
      &lt;service name="weddingservice"&gt;
        &lt;endpoint binding="webHttpBinding" contract="RestService.Iweddingservice" behaviorConfiguration="webHttp"/&gt;
      &lt;/service&gt;
    &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name=""&gt;
        &lt;serviceMetadata httpGetEnabled="true" /&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
    &lt;endpointBehaviors&gt;
      &lt;behavior name="webHttp"&gt;
        &lt;webHttp/&gt;
      &lt;/behavior&gt;
    &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;  
  </code></pre>