views:

33

answers:

1

I'm building an application based on the WebSharingAppDemo-CEProviderEndToEnd. When I deploy the server portion on a server, the code gives the error "The path is not valid. Check the directory for the database." during the call to NeedsScope() in the CeWebSyncService.cs file.

Obviously the server can't access the client's sdf but what is supposed to happen to make this work? The app uses batching to send the data and the batches have to be marshalled across to the temp directory but this problem is occurring before any files have been batched over. There is nothing for the server to look at to determine whether the peerProivider needs scope. What am I missing?

public bool NeedsScope()
{
    Log("NeedsSchema: {0}", this.peerProvider.Connection.ConnectionString);
    SqlCeSyncScopeProvisioning prov = new SqlCeSyncScopeProvisioning();

    return !prov.ScopeExists(this.peerProvider.ScopeName, (SqlCeConnection)this.peerProvider.Connection);
}
A: 

I noticed that the sample was making use of a proxy to speak w/ the CE file but a provider (not a proxy) to speak w/ the sql server.

I switched it so there is a proxy to reach the SQL server and a provider to access the CE file.

That seems to work for me.

stats = synchronizationHelper.SynchronizeProviders(srcProvider, destinationProxy);

vs.

SyncOperationStatistics stats = syncHelper.SynchronizeProviders(srcProxy, destinationProvider);

Don