1

我目前正在设计一个需要在“偶尔断开”模式下运行的智能客户端应用程序 (WPF)。对于离线场景,我正在考虑使用:

  • 断开连接的服务代理应用程序块(来自智能客户端软件工厂)
  • 微软同步框架

我应该提一下,我希望我的智能客户端应用程序可以 XCOPY 部署、自动更新和安装,而无需管理权限——基本上是 ClickOnce 部署的应用程序。据我所知,这意味着 Microsoft Sync Framework 已经退出,因为它的实现中有一些 COM 需要在需要管理员权限的客户端上注册。是否可以从 ClickOnce 应用程序 XCOPY 部署和运行 MSF?还有其他关于数据同步的想法吗?

4

3 回答 3

1

Why would you use the Sync Framework? Is there a specific use case you have in mind where it would work well?

The DSA will stack up the service calls and once a connection becomes available it will start to shoot those calls off to the relevant services. It's not something you could really Sync.

What we've done in my last two Smart Client apps was a simple manual implementation for 'sync-ing' things like reference data. Anything that get's sync-ed does not through the DSA (sync logically only occurs in connected mode).

Client side for each 'piece' of data that needs sync-ing we store the datetime it was last synchronized. To sync we send the piece 'type' with the last updated time, then the server sends back the delta of new and updated items. Doesn't handle the case for deleted items but that generally makes it tricky.

In my current app we synchronize this data at startup of the app as this is sufficient but in my previous system we had a background thread running which would check every minute or so if each 'piece' needs to updated (eg every 24 hours for unimportant items, 1 hour for important ones) and asynchronously initiate the sync if required.

It's a little bit of extra work client and server side but honestly I believe it's less work than trying to get some external framework to do it for, especially if that framework cannot be deployed within your clickonce deployment package.

Making your app 'occassionally connected' hugely adds to the complexity of the system...so good luck!

于 2010-03-04T23:35:01.423 回答
1

据我所知,MSF 需要管理员安装——这让我很恼火,因为早期版本的 Sync for ADO.NET 没有。

于 2009-11-01T23:50:34.767 回答
1

嗨,也许有点太晚了,但你可以使用引导程序包。“ ...Sync Framework 2.0 引导程序包示例,可与 Visual Studio 安装和部署项目以及 ClickOnce 应用程序一起使用,以重新分发 Sync Framework 2.0 组件... ”(http://www.microsoft.com/downloads/details.aspx ?familyid=109DB36E-CDD0-4514-9FB5-B77D9CEA37F6&displaylang=en )

于 2010-03-26T10:52:30.023 回答