WebSharingAppDemo-CEProviderEndToEnd 在将任何文件批处理到服务器之前查询 PeerProvider 的 NeedsScope。这看起来不太正常?
我正在构建一个基于 WebSharingAppDemo-CEProviderEndToEnd 的应用程序。当我在服务器上部署服务器部分时,代码给出错误“路径无效。请检查数据库的目录。”在 CeWebSyncService.cs 文件中调用 NeedsScope() 期间。
显然,服务器无法访问客户端的 sdf,但是应该怎样做才能使其工作呢?该应用程序使用批处理来发送数据,并且必须将批处理数据编组到临时目录,但此问题是在对任何文件进行批处理之前发生的。服务器不需要查看任何内容来确定 PeerProivider 是否需要范围。我缺少什么?
public bool NeedsScope()
{
Log("NeedsSchema: {0}", this.peerProvider.Connection.ConnectionString);
SqlCeSyncScopeProvisioning prov = new SqlCeSyncScopeProvisioning();
return !prov.ScopeExists(this.peerProvider.ScopeName, (SqlCeConnection)this.peerProvider.Connection);
}
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);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我注意到该示例使用代理与 CE 文件进行交互,但使用提供程序(不是代理)与 sql 服务器进行交互。
我对其进行了切换,以便有一个代理可以访问 SQL 服务器,并且有一个提供程序可以访问 CE 文件。
这似乎对我有用。
统计数据=synchronizeHelper.SynchronizeProviders(srcProvider,destinationProxy);
与
SyncOperationStatistics stats =syncHelper.SynchronizeProviders(srcProxy, destinationProvider);
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);