9

One of 4 production servers once in a while generates tons of error claiming:

Method RunRules is not supported on this proxy, this can happen if the method is not marked with OperationContractAttribute or if the interface type is not marked with ServiceContractAttribute.

The method "RunRules" is one of the methods in wcf [ServiceContract] interface, and it is marked as [OperationContract].

Before this error, in the same method, occasionally it would get a wrong service through castle container. After I put more logging information to nail down exact cause, it mutated into the current error.

It is a webservice the error comes out of, it tries to call into a windows service through wcf endpoint when this happens. And this only happens on one specific machine. The frequency is about once a week or 2 weeks. Once recycle of the webservice happens (3 hours), the error stops.

To me it is almost like corrupted vtable. Just wondering, how would you approach this problem? Hate to ask IT people start to re-image the machine without solid proof.

Thanks!

Aran Mulholland
  • 23,555
  • 29
  • 141
  • 228
Zhen.Lee
  • 189
  • 8
  • 1
    have you found a solution to this problem? we've got a very similar issue. – Kostassoid Apr 17 '12 at 20:53
  • 1
    I have the same error using castle wcf facility. restarting the web site in IIS fixes it for me. But I also would like the answer. – Aran Mulholland Apr 18 '12 at 01:56
  • How are you registering your services on the client? – Aran Mulholland Apr 18 '12 at 02:43
  • I have also got this error having IIS on my local machine and doing a build from visual studio. This is when I need to restart the web site in IIS, seems it got mixed up. @Kostassoid did you find a solution? – Aran Mulholland Apr 20 '12 at 02:47
  • @AranMulholland: not yet. we figured as much as you do, had to restart apppool to get it back to work. but it happened only once so we don't have any statistics. the only interesting thing is that we've got both iis and windows-service based WCFs and only IIS-based proxies failed. – Kostassoid Apr 20 '12 at 10:47
  • Just for clarification - "Before this error, in the same method, occasionally it would get a wrong service through castle container." are you using WCF Integration Facility with Castle (using WindsorServiceHostFactory)? Is this service pure (no DI containers etc.)? – Petar Vučetin Apr 23 '12 at 06:45
  • @PetarVucetin When we get this error we are using WindsorSevcieHostFactory on the service end and also using the wcf facility to resolve the services on the client side. – Aran Mulholland Apr 23 '12 at 07:06
  • That would be my prime suspect. – Petar Vučetin Apr 23 '12 at 15:17

1 Answers1

0

No simple answer for such abstract magic error, so try out logging entire call stack, especially internal Castle DLL calls, if standart exception does not contain such deep call stack information - use reflection.

// use this in loop incrementing levelIndex up to st.FrameCount
// to grab all possible callstack entries
StackTrace st = new StackTrace();
st.GetFrame(levelIndex).GetMethod().Name;

Then using utility like ILSpy disassemble Castle DLL and try out analyze which state causes concrete execution flow which ends up with exception you got.

If you able log callstack - please share so I would be able check it as well.

sll
  • 61,540
  • 22
  • 104
  • 156