|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Ex2003 PF Async Event Sink OnDelete fires OnSave doesn'tmethod would work fine and the other not in a managed code store event sink registered to a mail enabled public folder. Right now I have in my sink just debugging code which writes to a txt file and the event log when the method fires. Everything looks fine, including the registration in the SystemMailbox{GUID} as viewed in MFCMAPI utility. There are no errors happening anywhere that I can see. I delete a message in the folder and I get an event log entry. A message gets delivered or I copy a message to the folder and nothing happens. Bizarre... Will someone please advise on where to turn up logging or maybe pointers to using windbg on COM+ managed code interfaces to see where the failure is? Any help gratefully received. ~JasonG -- An example log entry from my OnDelete code looks like this: OnDelete Fired at 02/02/09 10:33:54 Script fired by file://./backofficestorage/npumail.com/Public Folders/zTest CBYD/Testing.EML Here are snippets from the top of each method: public void OnSave(IExStoreEventInfo pEventInfo, string bstrURLItem, int lFlags) { try { //Debugging System.Diagnostics.EventLog EvtLog1 = new System.Diagnostics.EventLog(); if (!System.Diagnostics.EventLog.SourceExists("EvtSink_CBYD")) { System.Diagnostics.EventLog.CreateEventSource( "EvtSink_CBYD", "Application"); } EvtLog1.Source = "EvtSink_CBYD"; EvtLog1.WriteEntry("OnSave Fired"); StreamWriter logFile = new StreamWriter( @"c:\tmp\EventSink\run.log", true); logFile.AutoFlush = true; logFile.Write("OnSave Fired at " + System.DateTime.Now + "\n"); logFile.Write("Script fired by " + bstrURLItem + "\n"); logFile.Close(); logFile.Dispose(); // ... Omitted ... } public void OnDelete(IExStoreEventInfo pEventInfo, string bstrURLItem, int lFlags) { try { //Debugging System.Diagnostics.EventLog EvtLog1 = new System.Diagnostics.EventLog(); if (!System.Diagnostics.EventLog.SourceExists("EvtSink_CBYD")) { System.Diagnostics.EventLog.CreateEventSource( "EvtSink_CBYD", "Application"); } EvtLog1.Source = "EvtSink_CBYD"; EvtLog1.WriteEntry("OnDelete Fired"); StreamWriter logFile = new StreamWriter( @"c:\tmp\EventSink\run.log", true); logFile.AutoFlush = true; logFile.Write("OnDelete Fired at " + System.DateTime.Now + "\n"); logFile.Write("Script fired by " + bstrURLItem + "\n"); logFile.Close(); logFile.Dispose(); // ... Omitted ... } On 2 Feb, 23:55, Jason Gurtz <jasonNOgu...@npuSPAMmail.com> wrote:
Show quoteHide quote > I can't seem to find any pointers anywhere on how to debug why one Hi,> method would work fine and the other not in a managed code store event > sink registered to a mail enabled public folder. > > Right now I have in my sink just debugging code which writes to a txt > file and the event log when the method fires. Everything looks fine, > including the registration in the SystemMailbox{GUID} as viewed in > MFCMAPI utility. > > There are no errors happening anywhere that I can see. I delete a > message in the folder and I get an event log entry. A message gets > delivered or I copy a message to the folder and nothing happens. Bizarre... > > Will someone please advise on where to turn up logging or maybe pointers > to using windbg on COM+ managed code interfaces to see where the failure > is? Any help gratefully received. > > ~JasonG > > -- > > An example log entry from my OnDelete code looks like this: > > OnDelete Fired at 02/02/09 10:33:54 > Script fired by file://./backofficestorage/npumail.com/Public > Folders/zTest CBYD/Testing.EML > > Here are snippets from the top of each method: > > public void OnSave(IExStoreEventInfo pEventInfo, > string bstrURLItem, int lFlags) > { > try { > //Debugging > System.Diagnostics.EventLog EvtLog1 = new > System.Diagnostics.EventLog(); > > if (!System.Diagnostics.EventLog.SourceExists("EvtSink_CBYD")) { > System.Diagnostics.EventLog.CreateEventSource( > "EvtSink_CBYD", "Application"); > } > EvtLog1.Source = "EvtSink_CBYD"; > EvtLog1.WriteEntry("OnSave Fired"); > > StreamWriter logFile = new StreamWriter( > @"c:\tmp\EventSink\run.log", true); > logFile.AutoFlush = true; > logFile.Write("OnSave Fired at " + System.DateTime.Now + "\n"); > logFile.Write("Script fired by " + bstrURLItem + "\n"); > logFile.Close(); logFile.Dispose(); > > // ... Omitted ... > > } > > public void OnDelete(IExStoreEventInfo pEventInfo, > string bstrURLItem, int lFlags) > { > try { > //Debugging > System.Diagnostics.EventLog EvtLog1 = new > System.Diagnostics.EventLog(); > > if (!System.Diagnostics.EventLog.SourceExists("EvtSink_CBYD")) { > System.Diagnostics.EventLog.CreateEventSource( > "EvtSink_CBYD", "Application"); > } > EvtLog1.Source = "EvtSink_CBYD"; > EvtLog1.WriteEntry("OnDelete Fired"); > > StreamWriter logFile = new StreamWriter( > @"c:\tmp\EventSink\run.log", true); > > logFile.AutoFlush = true; > logFile.Write("OnDelete Fired at " + System.DateTime.Now + > "\n"); > > logFile.Write("Script fired by " + bstrURLItem + "\n"); > logFile.Close(); logFile.Dispose(); > > // ... Omitted ... > > } have you tryed to instantiate the object from vbscript or javascript ? For istance : var ooo set ooo = CreateObject("MyObject.MyClass") ooo.OnSave Nothing , "URL", 0 set ooo = Nothing ................ Doing this way you'll see if the object/method itself is working in the right way. Please, tell me if your pEventInfo is correcly populated in OnDelete (). Bye Massimiliano Piccinini wrote:
[...] > Hi, Thank you for your response Massimiliano. This test has led me to the> have you tryed to instantiate the object from vbscript or javascript ? > For istance : solution to my problem (a really nice gotcha!). I found the test a missing reference on the exchange machine: there was no %programfiles%\Microsoft.NET\Primary Interop Assemblies which has in it on my development machine adodb.dll version 7.10.3077.0 If one googles for "adodb.dll pia missing" it is a common problem with no great answer. I installed the latest office 2007 Primary Interop Assemblies redistributable on the server, but it installs an older version of adodb.dll (strangely a year newer than the actual later version installed by VS.2005). I found the best solution without making dll hell even more polluted was to delete the present adodb ref from the .NET tab and make a new ref from browse to a copy that sits right in the project's \bin I hope microsoft will update the office pia redist or create a separate ADO.Net pia redist. I REALLY hope they update their building managed event sink dlls msdn entry to mention adodb.dll ref (I found the article code example will not build as is in VS.2005) and also the real need to build a deployment package to manage this reference since the framework does not install this. Thanks, ~JasonG --
Other interesting topics
Incremental email updates via webdav
Delegated Admin View Only Query Exchange 2003 mailbox store (mailbox sizes etc) Intercepting emails as they are sent Forms-based authentication in Exchange 2003 AND Exchange 2007 Exchange 2007 Backup/Restore API problem Outgoing emails: add automatically actual information and / or attachment OWA extension problem 500 Internal Server Error UTF-8 or Unicode Email Addresses |
|||||||||||||||||||||||