ibatis.net 不明确的引用 Ambiguous match found

We are using IBatis Data Access 1.9.2 since a long time with .NET 3.5SP1 and 
it's working fine.
Also we decide to transfer part of the project to .NET 4 and we have some 
errors in the IBatis Builder.Configure method.

----------------------------------------
I have noticed that the error is within the Castle.DynamicProxy dll.  More 
specifically, the class file in that dll: 
Castle.DynamicProxy.Builder.CodeBuilder.SimpleAST.LockBlockExpression invokes 
with reflection the method System.Threading.Monitor.Enter without specifying 
(new in .net 4.0) the overload arguments. Changing that line of code to: 
gen.Emit(OpCodes.Call, typeof(Monitor).GetMethod("Enter", new Type[] { 
typeof(object) })); should solve the problem.
------------------------------------------
In the mean time, you can set the target framework in the properties window for 
your project to .net 3.5 and that will solve the issue as well.
-------------------------------------------------------
简言之,ibatis.net 某些版本在4.0环境下会出现标题的问题,这是一个BUG!要解决它可以用新的Castle.DynamicProxy.
引用不同版本的dll可以参见https://blog.csdn.net/dang13579/article/details/72956684
防止其它project的ibatis引用捣乱可以把dll属性的复制到本地改为false,总之是个有些烦人的bug
,牵扯到dll签名,引用不同版本的dll,以及dll复制等.

posted @ 2020-03-07 22:05  angrycoder  阅读(140)  评论(0编辑  收藏  举报