none
Problem: WCF endpoint works on development machine but not when deployed to production environment. RRS feed

  • Question

  • I have developed a WCF Windows service which has the following entry in app.config

        <services>

          <servicename="WCFWinService.WCFService">

            <endpointaddress="" binding="netNamedPipeBinding" bindingConfiguration="" contract="WCFWinService.IWCFService">

              <identity>

                <dnsvalue="localhost" />

              </identity>

            </endpoint>

            <endpointaddress="mex" binding="mexNamedPipeBinding" bindingConfiguration="" contract="IMetadataExchange" />

            <host>

              <baseAddresses>

                <addbaseAddress="net.pipe://localhost/Design_Time_Addresses/WCFWinService/WCFService/" />

              </baseAddresses>

            </host>

          </service>

    The client that consumes it, which runs on the same machine, is a web service. I added a service reference to the web service project and it made the following entry to web.config:

    <system.serviceModel>

            <bindings>

                <netNamedPipeBinding>

                    <bindingname="NetNamedPipeBinding_IWCFService" closeTimeout="00:01:00"

                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

                        transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"

                        hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"

                        maxBufferSize="65536" maxConnections="10" maxReceivedMessageSize="65536">

                        <readerQuotasmaxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />

                        <securitymode="Transport">

                            <transportprotectionLevel="EncryptAndSign" />

                        </security>

                    </binding>

                </netNamedPipeBinding>

            </bindings>

            <client>

                <endpointaddress="net.pipe://localhost/Design_Time_Addresses/WCFWinService/WCFService/"

                    binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IWCFService"

                    contract="ServiceReference1.IWCFService" name="NetNamedPipeBinding_IWCFService">

                    <identity>

                        <dnsvalue="localhost" />

                    </identity>

                </endpoint>

            </client>

        </system.serviceModel>

    Adding the service reference also created a configuration.svcinfo file which also contains a similar endpoint reference.

    Everything works in the development environment and the web service client is able to call the windows service.

    I deployed the WCF to the production machine by copying the files unchanged and installing the service using installutil. The service was started with no errors.

    I also deployed the Web Service to the same production machine and tested it but the endpoint no longer works and gives an error:

    Could not find default endpoint element that references contract 'B1ToCIS_WCF.IWCFService' in the ServiceModel……………

    Questions:

    Do I have to change the base address in the Windows Service app.config? To what?

    Do I have to change the endpoint address in the web Service web.config? To what?

    Do I need to change configuration.svcinfo?

    Do I need to change anything else to make it work?

    Thanks in advance for any help.

    Wednesday, February 27, 2013 10:55 AM

Answers

  • Hi,

    Design time address is something that Visual Studio creates details. So it won't work on deployment machines.

    1 & 2. Just remove the Desgin_Time_Address in the both app.config and web.config.

    net.pipe://localhost/WCFWinService/WCFService/

    3. No need to change .svcinfo

    4. You may[not sure as you are using namedpipes] need to run your apps with Administrator privileges.

    /Srinivas



    • Marked as answer by meld7426 Wednesday, February 27, 2013 1:18 PM
    Wednesday, February 27, 2013 12:02 PM

All replies

  • Hi,

    Design time address is something that Visual Studio creates details. So it won't work on deployment machines.

    1 & 2. Just remove the Desgin_Time_Address in the both app.config and web.config.

    net.pipe://localhost/WCFWinService/WCFService/

    3. No need to change .svcinfo

    4. You may[not sure as you are using namedpipes] need to run your apps with Administrator privileges.

    /Srinivas



    • Marked as answer by meld7426 Wednesday, February 27, 2013 1:18 PM
    Wednesday, February 27, 2013 12:02 PM
  • Thanks, Srinivas!

    That solved it.

    Wednesday, February 27, 2013 1:19 PM