locked
TargetInvocationException after turning off WcfSvcHost RRS feed

  • Question

  • I have a smartdevice app which I deploy to Windows CE 6.0 device. My local cache database is being synched wiht sql server 2005 trough my wcf. When I deploy my app, WcfSvcHost is also started and synchronization is successful.

    If I turn WcfSvcHost off, and want to sync database over WCF which I host in IIS, "syncagent.synchronize" crashes with TargetInvocationException (InnerException = {"The remote server returned an unexpected response: (405) Method Not Allowed."})

    I can access WCF service from my windows ce 6.0 device with internet explorer.

    <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> </configSections> <connectionStrings> <add name="MyAppSyncServiceLibrary.My.MySettings.ServerMyAppDBConnectionString" connectionString="Data Source=PC11\SQLEXPRESS;Initial Catalog=MyAppDB;Integrated Security=True" providerName="System.Data.SqlClient" /> </connectionStrings> <system.web> <compilation debug="true" /> </system.web> <!-- When deploying the service library project, the content of the config file must be added to the host's app.config file. System.Configuration does not support config files for libraries. --> <system.serviceModel> <serviceHostingEnvironment multipleSiteBindingsEnabled ="true" /> <services> <service name="MyAppSyncServiceLibrary.MyAppDBSyncService" behaviorConfiguration="MyAppSyncServiceLibrary.MyAppDBSyncServiceBehavior"> <host> <baseAddresses> <add baseAddress="http://localhost:8888/MyAppDBSyncService/" /> </baseAddresses> </host> <!-- Service Endpoints --> <!-- Unless fully qualified, address is relative to base address supplied above --> <endpoint address="" binding="basicHttpBinding" contract="MyAppSyncServiceLibrary.IMyAppDBSyncContract"> <!-- Upon deployment, the following identity element should be removed or replaced to reflect the identity under which the deployed service runs. If removed, WCF will infer an appropriate identity automatically. --> <identity> <dns value="localhost"/> </identity> </endpoint> <!-- Metadata Endpoints --> <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. --> <!-- This endpoint does not use a secure binding and should be secured or removed before deployment --> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> <behaviors> <serviceBehaviors> <behavior name="MyAppSyncServiceLibrary.MyAppDBSyncServiceBehavior"> <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment --> <serviceMetadata httpGetEnabled="True"/> <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information --> <serviceDebug includeExceptionDetailInFaults="True" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>

    I tried changing local host with my IP but that doesn't help (I thought it does and then found out I was missing that everything was running over service running in WcfSvcHost)

    Any help is very appreciated,

    best regards,

    Greg

    Thursday, September 5, 2013 8:14 AM