Windows Vista Forums

WCF - Contract name could not be found
  1. #1


    Sapnil Guest

    WCF - Contract name could not be found

    Hi,

    I get the following error when I try to access *.svc file

    "The contract name 'WCFService.IHello1' could not be found in the list of
    contracts implemented by the service 'HelloService'. "

    Stack Trace:


    [InvalidOperationException: The contract name 'WCFService.IHello1' could not
    be found in the list of contracts implemented by the service 'HelloService'.]
    System.ServiceModel.Description.ConfigLoader.LookupContract(String
    contractName, String serviceName) +4321718

    System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase
    host, ServiceDescription description, ServiceElement serviceElement, Action`1
    addBaseAddress) +175
    System.ServiceModel.ServiceHostBase.ApplyConfiguration() +146

    System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) +182
    System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[]
    baseAddresses) +236
    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type
    serviceType, Uri[] baseAddresses) +28

    System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String
    constructorString, Uri[] baseAddresses) +323
    System.ServiceModel.HostingManager.CreateService(String
    normalizedVirtualPath) +698
    System.ServiceModel.HostingManager.ActivateService(String
    normalizedVirtualPath) +31
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String
    normalizedVirtualPath) +445

    [ServiceActivationException: The service '/WCFService/FirstWCFService.svc'
    cannot be activated due to an exception during compilation. The exception
    message is: The contract name 'WCFService.IHello1' could not be found in the
    list of contracts implemented by the service 'HelloService'..]
    System.ServiceModel.HostingManager.EnsureServiceAvailable(String
    normalizedVirtualPath) +962

    System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath) +419

    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.HandleRequest()
    +260

    System.ServiceModel.Activation.HostedHttpRequestAsyncResult.BeginRequest()
    +760
    System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext
    context) +43

    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +154
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
    completedSynchronously) +64


    Any ideas?

    Sapnil





      My System SpecsSystem Spec

  2. #2


    Marc Gravell Guest

    Re: WCF - Contract name could not be found

    2 things to look at first:
    a: does HelloService actually implement IHello1
    b: is IHello1 marked [ServiceContract], with methods marked
    [OperationContract]?

    Marc


      My System SpecsSystem Spec

  3. #3


    Sapnil Guest

    Re: WCF - Contract name could not be found

    a: does HelloService actually implement IHello1 - yes
    b: is IHello1 marked [ServiceContract], with methods marked
    [OperationContract]? Yes

    I also tried to run the WCF samples available on MSDN, but I get the same
    error

    Sapnil

    "Marc Gravell" wrote:

    > 2 things to look at first:
    > a: does HelloService actually implement IHello1
    > b: is IHello1 marked [ServiceContract], with methods marked
    > [OperationContract]?
    >
    > Marc
    >
    >
    >

      My System SpecsSystem Spec

  4. #4


    Arkady Frenkel Guest

    Re: WCF - Contract name could not be found

    Do you have inetpub directory set as wcf demand , just a hint ?
    Arkady

    "Sapnil" <Sapnil@discussions.microsoft.com> wrote in message
    news:7277C3C4-477A-44C5-8E39-41D27BF7C23C@microsoft.com...
    > a: does HelloService actually implement IHello1 - yes
    > b: is IHello1 marked [ServiceContract], with methods marked
    > [OperationContract]? Yes
    >
    > I also tried to run the WCF samples available on MSDN, but I get the same
    > error
    >
    > Sapnil
    >
    > "Marc Gravell" wrote:
    >
    >> 2 things to look at first:
    >> a: does HelloService actually implement IHello1
    >> b: is IHello1 marked [ServiceContract], with methods marked
    >> [OperationContract]?
    >>
    >> Marc
    >>
    >>
    >>



      My System SpecsSystem Spec

  5. #5


    Arkady Frenkel Guest

    Re: WCF - Contract name could not be found

    I mean did all from http://msdn2.microsoft.com/en-us/library/ms751527.aspx
    done ?
    Arkady

    "Arkady Frenkel" <arkadyf@hotmailxdotx.com> wrote in message
    news:eZYwWtMfHHA.3648@TK2MSFTNGP05.phx.gbl...
    > Do you have inetpub directory set as wcf demand , just a hint ?
    > Arkady
    >
    > "Sapnil" <Sapnil@discussions.microsoft.com> wrote in message
    > news:7277C3C4-477A-44C5-8E39-41D27BF7C23C@microsoft.com...
    >> a: does HelloService actually implement IHello1 - yes
    >> b: is IHello1 marked [ServiceContract], with methods marked
    >> [OperationContract]? Yes
    >>
    >> I also tried to run the WCF samples available on MSDN, but I get the same
    >> error
    >>
    >> Sapnil
    >>
    >> "Marc Gravell" wrote:
    >>
    >>> 2 things to look at first:
    >>> a: does HelloService actually implement IHello1
    >>> b: is IHello1 marked [ServiceContract], with methods marked
    >>> [OperationContract]?
    >>>
    >>> Marc
    >>>
    >>>
    >>>

    >
    >



      My System SpecsSystem Spec

  6. #6


    Sapnil Guest

    Re: WCF - Contract name could not be found

    Yes, I have done every thing mentioned in the article.

    I am facing this problem only when I try to host the service in IIS
    Self hosting works fine

    Regards,

    Sapnil

    "Arkady Frenkel" wrote:

    > I mean did all from http://msdn2.microsoft.com/en-us/library/ms751527.aspx
    > done ?
    > Arkady
    >
    > "Arkady Frenkel" <arkadyf@hotmailxdotx.com> wrote in message
    > news:eZYwWtMfHHA.3648@TK2MSFTNGP05.phx.gbl...
    > > Do you have inetpub directory set as wcf demand , just a hint ?
    > > Arkady
    > >
    > > "Sapnil" <Sapnil@discussions.microsoft.com> wrote in message
    > > news:7277C3C4-477A-44C5-8E39-41D27BF7C23C@microsoft.com...
    > >> a: does HelloService actually implement IHello1 - yes
    > >> b: is IHello1 marked [ServiceContract], with methods marked
    > >> [OperationContract]? Yes
    > >>
    > >> I also tried to run the WCF samples available on MSDN, but I get the same
    > >> error
    > >>
    > >> Sapnil
    > >>
    > >> "Marc Gravell" wrote:
    > >>
    > >>> 2 things to look at first:
    > >>> a: does HelloService actually implement IHello1
    > >>> b: is IHello1 marked [ServiceContract], with methods marked
    > >>> [OperationContract]?
    > >>>
    > >>> Marc
    > >>>
    > >>>
    > >>>

    > >
    > >

    >
    >
    >

      My System SpecsSystem Spec

  7. #7


    Arkady Frenkel Guest

    Re: WCF - Contract name could not be found

    That's strange because that article exactly for IIS, do IIS service run at
    all ?
    Arkady

    "Sapnil" <Sapnil@discussions.microsoft.com> wrote in message
    news:9E7F0A62-70BB-4D8E-8B70-A2DC56B871A1@microsoft.com...
    > Yes, I have done every thing mentioned in the article.
    >
    > I am facing this problem only when I try to host the service in IIS
    > Self hosting works fine
    >
    > Regards,
    >
    > Sapnil
    >
    > "Arkady Frenkel" wrote:
    >
    >> I mean did all from
    >> http://msdn2.microsoft.com/en-us/library/ms751527.aspx
    >> done ?
    >> Arkady
    >>
    >> "Arkady Frenkel" <arkadyf@hotmailxdotx.com> wrote in message
    >> news:eZYwWtMfHHA.3648@TK2MSFTNGP05.phx.gbl...
    >> > Do you have inetpub directory set as wcf demand , just a hint ?
    >> > Arkady
    >> >
    >> > "Sapnil" <Sapnil@discussions.microsoft.com> wrote in message
    >> > news:7277C3C4-477A-44C5-8E39-41D27BF7C23C@microsoft.com...
    >> >> a: does HelloService actually implement IHello1 - yes
    >> >> b: is IHello1 marked [ServiceContract], with methods marked
    >> >> [OperationContract]? Yes
    >> >>
    >> >> I also tried to run the WCF samples available on MSDN, but I get the
    >> >> same
    >> >> error
    >> >>
    >> >> Sapnil
    >> >>
    >> >> "Marc Gravell" wrote:
    >> >>
    >> >>> 2 things to look at first:
    >> >>> a: does HelloService actually implement IHello1
    >> >>> b: is IHello1 marked [ServiceContract], with methods marked
    >> >>> [OperationContract]?
    >> >>>
    >> >>> Marc
    >> >>>
    >> >>>
    >> >>>
    >> >
    >> >

    >>
    >>
    >>



      My System SpecsSystem Spec

WCF - Contract name could not be found problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Contract Worker Jason Server General 4 21 Oct 2009
Contract of Friendship NormCameron Chillout Room 5 01 Jan 2009
Contract name could be any on the client Leonid Ganeline Indigo 0 25 Apr 2008
Is data contract evil? akolsen@gmail.com Aero 0 20 Jun 2006
using local implimentation of contract using local binding Indigo 3 04 Mar 2006