PDA

View Full Version : Activating EurekaLog With Silverlight Project Creates Compiler Errors


jammerms
16-Sep-2011, 03:36 PM
Hello,

I am having problems getting EurekaLog to work in my Silverlight project.

Steps I took:
-Install latest version of EurekaLog
-Open my solution in Visual Studio 2010 (.NET 4.0)
-Select Silverlight Project (Silverlight 4)
-EurekaLog menu -> select EurekaLog Project Options...
-Activate EurekaLog
-Make sure that Log File is selected to Save.
-Click OK out of the dialog
-Compile project...FAIL.

I am getting three compilation errors:
1. "The type or namespace 'DispatcherUnhandledExceptionEventArgs' does not exist in the namespace 'System.Windows.Threading' (are you missing an assembly reference?" Since System.Windows.Threading does not exist to add in the Add Reference options, I looked it up on the Web and found that it exists in WindowsBase.dll. But if I try to add that dll, the error I get tells me it's not compiled for Silverlight and can't be added. This makes sense given that the MSDN documentation for DispatcherUnhandledExceptionEventArgs indicates that it only exists in .NET Framework 3.0 and higher, not Silverlight: http://msdn.microsoft.com/en-us/library/system.windows.threading.dispatcherunhandledexcept ioneventargs.aspx

The code that throws this exception is in App.xaml.cs:
//---------------------------------------------------------
// Do not modify or remove this method (used by EurekaLog)!
//---------------------------------------------------------
private void EurekaLogExceptionLog(object sender, System.Windows.Threading.DispatcherUnhandledExcept ionEventArgs e)
{
EurekaLogSystem.ExceptionHandler.HandleException(e .Exception);
e.Handled = true;
}

Question: Why is EurekaLog adding code to my Silverlight project that references assemblies that aren't compiled for Silverlight? What have I done wrong here (if anything)?

2. The second exception is that EurekaLogSystem does not exist in the current context (the EurekaLogSystem reference in the above code). I'm assuming I need some sort of dll reference here too.

3. "The property 'DispatcherUnhandledException' was not found in type 'Application'." This is an attribute in the Application tag in App.xaml: DispatcherUnhandledException="EurekaLogExceptionLog".

When I deactivate EurekaLog, the offending code is removed and everything compiles correctly. Please advise.

Thanks,
J

Biljana
19-Sep-2011, 10:36 AM
Hi jammerms,

Unfortunately EurekaLog doesn't support Silverlight applications yet.
You can suggest this at http://news.eurekalog.com/forumdisplay.php?f=12.
Thanks.