none
app.config service name RRS feed

  • Question

  • New computer Win 7; VS 2010; ASP.NET 4.0

    Trying to build a self hosted WCF Service. Yes, I have gone through the IIS setup procedure.

    Used the MSDN example as a template, but it omitted the Service.svc file, don't know why so I added it manually.

    App.config file entry questions:

    1. What to put for the service name? I have the <name_of_the_executable>.<name_of_the_service>

    2. What to put for the baseAddress? I have http://localhost:8000/ <name_of_the_executable>.<name_of_the_service>

    3. What to put for the endpoint contract? I have <name_of_the_executable>.<Name_of_the_service_interface>

    The service starts but there is no entry in the diagnostic file defined in the app config and I cannot see the service in the web application when I open add a service reference. If I try to force the connection I get the standard "connection actively refused" error message.

    Added note: Everything is in the excecutable - there is no DLL with the WCF service in it.

    Added Question: Is there any way to see the endpoint that the service is exposing short of connecting to it. I feel like I'm shooting in the dark.

    Obviously, I have something wrong, but not at all sure what or where.

    Any help will be appreciated.

    Thanks,

    RK




    • Edited by roadkill4299 Thursday, May 9, 2013 5:28 PM another question
    Thursday, May 9, 2013 2:18 PM

Answers

  • Hi,

    >>Trying to build a self hosted WCF Service

    If you want to create a self-hosted wcf service, you can create a simple one with below steps.

    1. Create a service library using WCF Service Library class( it will generate a default config file which includes endpoints etc.)
    2. Create a Console app as a client
    3. Build the service library, add a service reference by right click 'Service Reference', then click 'Add Service Reference', discover the service by click Discover button, click OK to add the service, it will generate client config file automatically. 

    And you can create a self-hosted service in a managed application(e.g Console app, Windows Forms app). Refer a sample in this thread on self hosting a wcf service in a Console application.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 10, 2013 2:49 AM
    Moderator
  • Thanks for the response.

    Took some trying, but I got it to work.

    RK


    Friday, May 10, 2013 5:37 PM

All replies

  • Hi,

    >>Trying to build a self hosted WCF Service

    If you want to create a self-hosted wcf service, you can create a simple one with below steps.

    1. Create a service library using WCF Service Library class( it will generate a default config file which includes endpoints etc.)
    2. Create a Console app as a client
    3. Build the service library, add a service reference by right click 'Service Reference', then click 'Add Service Reference', discover the service by click Discover button, click OK to add the service, it will generate client config file automatically. 

    And you can create a self-hosted service in a managed application(e.g Console app, Windows Forms app). Refer a sample in this thread on self hosting a wcf service in a Console application.

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, May 10, 2013 2:49 AM
    Moderator
  • Thanks for the response.

    Took some trying, but I got it to work.

    RK


    Friday, May 10, 2013 5:37 PM