同步/SQL Server Compact代码在最新版本中失败,SQL Compact 3.5。

时间:2021-03-18 09:38:02

This is most unusual for me.

这对我来说很不寻常。

This code has always worked (several years), just recently I started getting this error:

这段代码一直有效(好几年),就在最近,我开始犯这个错误:

Method not found: Void Microsoft.Synchronization.Data.SqlServerCe.SqlCeSyncProvider..ctor(System.String, System.Data.SqlServerCe.SqlCeConnection)'.

方法未找到:Void microsoft.synchroniz.data.sqlserverce.sqlcesyncprovider .ctor(系统)。字符串,System.Data.SqlServerCe.SqlCeConnection)”。

One of the main changes that I thought might have caused it was changing the target framework to .Net 4.6. But after changing back to 4.5.2, this is still an issue.

我认为可能造成的主要变化之一是将目标框架更改为。net 4.6。但是,在回到4.5.2之后,这仍然是一个问题。

I am calling a class using this line:

我用这句话给一个类打电话:

e.Result = SyncLogic.Synchronize(e.Argument.ToString());

It doesn't enter this class (SyncLogic), however, and I assume the conflicting line is this:

但是,它没有进入这个类(SyncLogic),我假设冲突的一行是这样的:

orch = new SyncOrchestrator
{
  RemoteProvider = new SqlSyncProvider(scopeName, sqlServerConn),
  LocalProvider = new SqlCeSyncProvider(scopeName, sqlCeConn),
  Direction = SyncDirectionOrder.Download
};

I have the same app installed (on my dev pc) and it works fine. Using a disassembler it appears to be using the same version of Microsoft.Synchronization.Data.SqlServerCe, which is 3.1.0.0, Runtime Version v2.0.50727.

我安装了相同的应用程序(在我的开发pc上),它运行得很好。使用反汇编器时,它似乎使用的是相同版本的microsoft.synchroniz.data。SqlServerCe,即3.1.0.0,运行时版本v2.0.50727。

So I don't know how the same assembly could work for one build but not another.

因此,我不知道同一个程序集如何适用于一个构建而不是另一个构建。

Thanks in advance!

提前谢谢!

1 个解决方案

#1


0  

This answer is actually a workaround rather than a solution. I don't know why had this problem, but I figured out that before my HD crashed the code worked. It was when I had to rebuild the project (because I lacked a recent backup) that the error started occurring.

这个答案实际上是一个变通方案,而不是解决方案。我不知道为什么会有这个问题,但我发现在HD崩溃之前,代码就已经工作了。正是在我不得不重新构建项目时(因为我缺少最近的备份),错误才开始发生。

The workaround was taking the older project, one that worked, keeping the references intact and copying in new code until it was up to date. So now I'm back in action but I really wish I knew why that error was happening since the references seemed to be identical. I need to let go of this anomaly and get on with life. Thanks for reading and learning this great moral lesson... keep your projects backed up!

解决方案是使用旧的项目,一个有效的项目,保持引用的完整,并在新代码中复制,直到最新为止。现在我回来了,但是我真的希望我知道为什么会发生这个错误,因为引用看起来是一样的。我需要摆脱这种不正常,继续生活下去。感谢您阅读和学习这一伟大的道德课程……保持你的项目备份!

#1


0  

This answer is actually a workaround rather than a solution. I don't know why had this problem, but I figured out that before my HD crashed the code worked. It was when I had to rebuild the project (because I lacked a recent backup) that the error started occurring.

这个答案实际上是一个变通方案,而不是解决方案。我不知道为什么会有这个问题,但我发现在HD崩溃之前,代码就已经工作了。正是在我不得不重新构建项目时(因为我缺少最近的备份),错误才开始发生。

The workaround was taking the older project, one that worked, keeping the references intact and copying in new code until it was up to date. So now I'm back in action but I really wish I knew why that error was happening since the references seemed to be identical. I need to let go of this anomaly and get on with life. Thanks for reading and learning this great moral lesson... keep your projects backed up!

解决方案是使用旧的项目,一个有效的项目,保持引用的完整,并在新代码中复制,直到最新为止。现在我回来了,但是我真的希望我知道为什么会发生这个错误,因为引用看起来是一样的。我需要摆脱这种不正常,继续生活下去。感谢您阅读和学习这一伟大的道德课程……保持你的项目备份!