Red Gate forums :: View topic - Automated Error Reporting for Outlook Add-ins?
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

Automated Error Reporting for Outlook Add-ins?

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
hdp



Joined: 24 Jan 2011
Posts: 6

PostPosted: Mon Jan 24, 2011 8:52 pm    Post subject: Automated Error Reporting for Outlook Add-ins? Reply with quote

Hi,

I am testing SA for reporting exceptions within an Outlook plugin. It doesn't seem to work because it's a DLL and there is a warning saying to call ExceptionReporting.Report(Exception) manually.

Could you give me any directions about it? I think there are plenty of add-ons working with SA, so I assume it's easy but I am not finding any documentation on Internet.

Thanks,
HDP
Back to top
View user's profile Send private message
ShortAngry



Joined: 02 Dec 2010
Posts: 14

PostPosted: Tue Jan 25, 2011 11:07 am    Post subject: Reply with quote

There's an article about error reporting with dlls here: http://www.red-gate.com/supportcenter/Content?p=SmartAssembly&c=SmartAssembly/help/5.5/SA_Errors_DLLs.htm&toc=SmartAssembly/help/5.5/toc1210439.htm

If you're still having trouble after reading it, I'd suggest you get in touch with support@red-gate.com
Back to top
View user's profile Send private message
hdp



Joined: 24 Jan 2011
Posts: 6

PostPosted: Fri Jan 28, 2011 3:27 pm    Post subject: Now I receive: This assembly has not yet been processed Reply with quote

Hi,

I followed the instructions. But after processing the assembly (and copying it to the original name) I receive the error pointed in the subject.


Thanks,
HDP
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6645

PostPosted: Fri Jan 28, 2011 4:20 pm    Post subject: Reply with quote

Hello,

If you just use ReportException.Report, this will do nothing on its' own. You must also process the assembly using SmartAssembly and enable error reporting, otherwise SA would not know which project to file the report under or who to send notification emails to, etc.
Back to top
View user's profile Send private message
hdp



Joined: 24 Jan 2011
Posts: 6

PostPosted: Fri Jan 28, 2011 4:42 pm    Post subject: Automated Error Reporting for Outlook Add-ins? Reply with quote

Hi Brian,

I also processed the DLL. What's strange is that I make it work in a simple project throwing the exception but not in a bigger project. I am doing the same in both projects: throwing a division by zero exception.

What can break smartassembly working? the other project has many references. If you can give me some direction it will be useful.

Thanks,
HDP
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6645

PostPosted: Fri Jan 28, 2011 5:13 pm    Post subject: Reply with quote

The message is shown whenever ReportException throws an exception. Maybe a div/0 exception is a bad example. Some exception types will actually stop the framework -- can you try just throwing a new Exception()?
Back to top
View user's profile Send private message
hdp



Joined: 24 Jan 2011
Posts: 6

PostPosted: Fri Jan 28, 2011 5:24 pm    Post subject: Reply with quote

I tried with that with the same effect. There is anything that can interfere with the SA build process?


Thanks,
HDP
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6645

PostPosted: Fri Jan 28, 2011 5:37 pm    Post subject: Reply with quote

Only explanation I have is an exception is being thrown whilst trying to report the exception.

Or the new build of the dll is not being loaded and you're still loading the old one. If you do versioning, you can update the version number of the dll and attach a debugger to your office app and look to see the version of the dll being loaded.
Back to top
View user's profile Send private message
hdp



Joined: 24 Jan 2011
Posts: 6

PostPosted: Sat Jan 29, 2011 8:36 pm    Post subject: Reply with quote

Brian, it seems that I discovered the source of the errors. And it has a high probability of being a SA bug:

i) Using IL DASM when it works with a simple add-in, SA adds a try/catch over our try/catch, and it catches System.Exception.

ii) Using IL DASM when it doesn't work with the real add-in, SA adds a try/catch over our try/catch, and it catches System.Web.HttpUtility (??? and this is not an exception).

Below is the code. Do you think a workaround for this exists?

Thanks,
HDP

i)

.try {
.try {
...
...
...
}catch [mscorlib]System.Excepton {
...
...
IL_003a: call void SmartAssembly.ReportException.ExceptionReporting::Report(class [mscorlib]System.Exception)
...
...
}
} catch [mscorlib]System.Exception
{
IL_0079: ldloc.0
IL_007a: ldloc.1
IL_007b: ldarg.0
IL_007c: call void SmartAssembly.SmartExceptionsCore.StackFrameHelper::CreateException3(class [mscorlib]System.Exception,
object,
object,
object)

}


ii)
.try {
.try {
...
...
...
}catch [mscorlib]System.Excepton {
...
...
IL_003a: call void SmartAssembly.ReportException.ExceptionReporting::Report(class [mscorlib]System.Exception)
...
...
}
} catch [System.Web]System.Web.HttpUtility
{
IL_004e: ldloc.0
IL_004f: ldarg.0
IL_0050: call void SmartAssembly.SmartExceptionsCore.StackFrameHelper::CreateException2(class [mscorlib]System.Exception,
object,
object)

}
Back to top
View user's profile Send private message
hdp



Joined: 24 Jan 2011
Posts: 6

PostPosted: Sun Jan 30, 2011 6:10 pm    Post subject: Reply with quote

More information:

If I remove references to System.Web.HttpUtility, now it points to

[System.Web.Services]System.Web.Services.WebServiceBindingAttribute

But I don't have a WebServiceBindingAttribute in my code. May be is used under a web reference (SOAP) that I am using.

Hope it helps in your way to find a solution.

Thanks,
HDP
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6645

PostPosted: Fri Feb 04, 2011 11:51 am    Post subject: Reply with quote

I don't think this IL is accurate. SmartAssembly obfuscates the exception reporting. If you disassemble in Reflector, you get:
Code:
public static void CreateException2(Exception exception1, object obj1, object obj2)
{
    // This item is obfuscated and can not be translated.
}
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group