Καλώς ορίσατε στο dotNETZone.gr - Σύνδεση | Εγγραφή | Βοήθεια

Remoting and Logging and Enterprise Library, Oh My!

I've been bitten by an almost undocumented bug of the Enterprise Library Logging Application Block. I have created a service that exposes an object through remoting for clients to call. The service uses the Exception Handling and Logging blocks throughout the code. Now, when a client calls the remote object, he gets a TargetInvocationException on top of an InvalidCastException. The object code has thrown no exceptions, logging works as expected, the method calls finish properly, but still the client gets an exception! The exceptions stop when I remove the logging code, but I can't very well replace the logging infrastructure of the service!

After a lot of stepping into code, re-checking my app.config files, googling for over two days, I came accross Keenan Newton's  article, Logging Application Block and Remoting . It seems that the way the Logging Block implements tracing writes something to the CallContext which doesn't serialize all that well. The quick solution is to disable tracing (just go to the Logging Application Block node and set TracingEnabled to false).
Thanks, Kean!

Perhaps, a better solution would be to create a remoting filter on the client or the server to remove the extra info added by the Logging block. Or even better, Microsoft fixes the Logging block so it works with remoting.

Έχουν δημοσιευτεί Παρασκευή, 17 Νοεμβρίου 2006 3:13 μμ από το μέλος Παναγιώτης Καναβός
Δημοσίευση στην κατηγορία:

Ενημέρωση για Σχόλια

Αν θα θέλατε να λαμβάνετε ένα e-mail όταν γίνονται ανανεώσεις στο περιεχόμενο αυτής της δημοσίευσης, παρακαλούμε γίνετε συνδρομητής εδώ

Παραμείνετε ενήμεροι στα τελευταία σχόλια με την χρήση του αγαπημένου σας RSS Aggregator και συνδρομή στη Τροφοδοσία RSS με σχόλια

Σχόλια:

Χωρίς Σχόλια

Ποιά είναι η άποψή σας για την παραπάνω δημοσίευση;

(απαιτούμενο) 
απαιτούμενο 
(απαιτούμενο) 
ÅéóÜãåôå ôïí êùäéêü:
CAPTCHA Image