When we tried running the Service, we hit this error : "Ambiguous Match"
I discovered that this is due to the Dynamic Proxy.DLL from Castle. Somehow, this code fails :
gen.Emit(OpCodes.Call, typeof(Monitor).GetMethod("Enter"));
So I modified the code to this call (based on some research) :
Which worked.
The reason for the error is due to Reflection's implementation difference from .NET 2.0 and .NET 4.0. .NET 4.0 requires a second parameter as opposed to the old one.
However, making it work is proven to be difficult as i don't have the signature key that is used for the Dynamic Proxy. Note that I decompiled the DLL to edit the code so I need to recompile it back. It took me few hours to get the original signature so that it would work on my project.
In-case you have the same issue, I have uploaded the source code that I modified as well as the resulting DLL so you can just re-use this without going through the nightmare I had gone thru.
Here's the link :
Here's the DLL link : https://www.dropbox.com/s/gk3zenow3ekoe0g/Castle.DynamicProxy.dll
Here's the source code link : https://www.dropbox.com/s/ndx1l55l8dk61n5/Castle.DynamicProxy.zip
Note that the source code was compiled using Visual Studio 2010. Enjoy!!
gen.Emit(OpCodes.Call, typeof(Monitor).GetMethod("Enter", new Type[] { typeof(object) }));