none
App.config : Service- name attribute not found

    Question

  •  

    Dear experts ,

     

     I ve downloaded the sample code 'programming wcf' provided for the 'Learn ABC of WCF' html page and tried to execute the app .When i run my app , i get the error messages as below 

    ---

    Error 1 The type or namespace name 'ServiceEndpoint' could not be found (are you missing a using directive or an assembly reference?) C:\Technologies\WCF\EchoServiceHost\Program.cs 41 30 EchoServiceHost


    Error 2 'System.ServiceModel.ServiceHost' does not contain a definition for 'EndpointListeners' C:\Technologies\WCF\EchoServiceHost\Program.cs 50 57 EchoServiceHost
    Error 3 The type or namespace name 'EndpointListener' could not be found (are you missing a using directive or an assembly

    reference?) C:\Technologies\WCF\EchoServiceHost\Program.cs 50 30 EchoServiceHost


    Error 4 The type or namespace name 'Binding' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?) C:\Technologies\WCF\EchoServiceClientGenerated\EchoServiceProxy.cs 47 49 EchoServiceClientGenerated
    --

     

    And i went to see the app.config file and found the service class doesnt have the type attribute .

    I dont have this 'type' attribute . It says that the required attribute 'name' is missing .

    <service type="ServiceLibrary.EchoService">

     

    i ve installed vs2005 ,vs2005 extns for .netframework 3.0 .

    ------

    Please tell me what configuration i missed  to make it work .

    thanks

    Raghu

    Friday, May 02, 2008 4:15 AM

Answers

  • Dan

     

    Thakns for the info . Fianlly it works.

     

     Yes , Channels , Description namespaces resolved Binding & Endpoint poblems .

     

    I still had a trouble to fix Endpointlisterners and finally came across Endpointisterners are changed to channeldispatchers .In this case , following code replaces the Endpointlisterners ...

     

    foreach (ChannelDispatcher c in host.ChannelDispatchers)

    ...

     

    And base.Innerproxy is changed as below

     

    base.Channel.Echo(msg);

     

     

    Finally it worked Smile

     

    Thanks to all .

    Raghu
    Saturday, May 03, 2008 5:57 AM

All replies

  • It should be

    <service name="ServiceLibrary.EchoService">


    It almost seems like you may not have System.ServiceModel added to your project References.  Make sure that is there.  Do you get intellisense in teh application for System.ServiceModel?

    Friday, May 02, 2008 12:22 PM
  • Hi Dan ,

     

    Thanks for the reply .

     I have simply downloaded the sample and try to execute it .

     

    Yah , the application has System.ServiceModel assembly added . I too get the ServiceModel intellisense in the GUI .

     

    . Though the name attribute in  App.config is not found ,now it is not shown as underlined error .

     

    but the errors are in the Follwing are the errors on my app

     

     ----------------------

    Error 1 The type or namespace name 'ServiceEndpoint' could not be found (are you missing a using directive or an assembly reference?) C:\Technologies\WCF\EchoServiceHost\Program.cs 42 30 EchoServiceHost
    Error 2 'System.ServiceModel.ServiceHost' does not contain a definition for 'EndpointListeners' C:\Technologies\WCF\EchoServiceHost\Program.cs 51 57 EchoServiceHost
    Error 3 The type or namespace name 'EndpointListener' could not be found (are you missing a using directive or an assembly reference?) C:\Technologies\WCF\EchoServiceHost\Program.cs 51 30 EchoServiceHost
    Error 4 The type or namespace name 'Binding' does not exist in the namespace 'System.ServiceModel' (are you missing an assembly reference?) C:\Technologies\WCF\EchoServiceClientGenerated\EchoServiceProxy.cs 47 49 EchoServiceClientGenerated

    -----------------------

    Can you please help me where i went wrong .

     

     

    Thanks

    Raghu

    Friday, May 02, 2008 2:54 PM
  •  

    Hi Raghu,

     

     To work with WCF, you need to install "WCF & WPF extensions for VS 2005" or VS 2008 comes with WCF.

     If you install this, your sample can find 'System.ServiceModel' dll in your machine. Then, everything should work.

     

    Download and Install WCF extension from below link,

    http://www.microsoft.com/downloads/details.aspx?FamilyId=F54F5537-CC86-4BF5-AE44-F5A1E805680D&displaylang=en 

     

    Thanks

    Padmaja

    Friday, May 02, 2008 5:57 PM
  • Hi Padmaja ,

     

    Thanks for the reply .

     

    It had been installed . I am sure that the wpf & wcf extns for vs2005 is installed and i found it in the control panel ,Even i tried reparing it . 

     

      I could use Servicehost class of system.servicemodel . But the bug clearly says probs with endpoints , end point listerners and binding.

     

     

    I would be very thankful if i get the some resolution for this .

     

    Thanks

    Raghu

    Friday, May 02, 2008 6:38 PM
  • In the Intellisense also, i have all objects listed for System.ServiceModel namespace except serviceendpoints , Endpointlisterner & Binding classes.  Please advice .

     

    Thanks

    Raghu

    Friday, May 02, 2008 7:04 PM
  • Those classes arent part of System>ServiecModel.  Binding is System.ServiceModel.Channels.Binding. ServiceEndpoint is System.ServiceModel.Description.ServiceEndpoint.  My guess is you need to add more using statments to your files or fully qualify the classes.

    using System.ServiceModel;
    using System.ServiceModel.Channels;
    using System.ServiceModel.Description;

    And maybe a couple of others...
    Friday, May 02, 2008 7:09 PM
  • Dan

     

    Thakns for the info . Fianlly it works.

     

     Yes , Channels , Description namespaces resolved Binding & Endpoint poblems .

     

    I still had a trouble to fix Endpointlisterners and finally came across Endpointisterners are changed to channeldispatchers .In this case , following code replaces the Endpointlisterners ...

     

    foreach (ChannelDispatcher c in host.ChannelDispatchers)

    ...

     

    And base.Innerproxy is changed as below

     

    base.Channel.Echo(msg);

     

     

    Finally it worked Smile

     

    Thanks to all .

    Raghu
    Saturday, May 03, 2008 5:57 AM