binkle
12-Feb-2010, 09:55 AM
Hi,
it's really sad that the .NET version still that buggy.
We love the Delphi version, but the .NET version is not yet woth using as long as setting all options programmatically doesn't work.
If you get a my simple "ApplStandardSettings" method to run properly for both send modes I guess we will buy the .Net version too:
static class InstallProgram
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(String[] args)
{
EurekaLogSystem.ExceptionHandler.Activate();
InstallProgram.ApplyStandardSettings("est@jam-software.de");
string text = null;
text.Clone();//invoke exception for testing
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
InstallForm eSTInstForm = new InstallForm();
eSTInstForm.DeInstallation = args.Length > 0;
Application.Run(eSTInstForm);
}
/// <summary>
/// Applies the standard settings of JAM-Software products to <see cref="T:EurekaLogSystem.ExceptionHandler"/>.
/// The default EmailSendMode is MailClient. For using SMTPClient as EmailSendMode call <see cref="T:Eurekalog.ApplyStandardSettings(pProductMailAddr ess,true)"/>
/// </summary>
/// <param name="pProductMailAddress">The product mail address.</param>
/// <author> binkle@jam-software.com </author>
public static void ApplyStandardSettings(string pProductMailAddress)
{
ApplyStandardSettings(pProductMailAddress, false);
}
/// <summary>
/// Applies the standard settings of JAM-Software products to <see cref="T:EurekaLogSystem.ExceptionHandler"/>.
/// </summary>
/// <param name="pProductMailAddress">The product mail address.</param>
/// <param name="pEMailSendModeSMTPClient">if set to <c>true</c> [EmailSendMode is SMTPClient] else [EmailSendMode is MailClient (Default)].</param>
/// <author> binkle@jam-software.com </author>
public static void ApplyStandardSettings(string pProductMailAddress, bool pEMailSendModeSMTPClient)
{
EurekaLogOptions options = EurekaLogSystem.ExceptionHandler.CurrentEurekaLogO ptions;
// Disable the following ELF contents: (Commented content stays enabled if enabled in Project options)
options.ShowOptions -= (
// Application
ShowOption.soExcAddress | ShowOption.soExcCount | ShowOption.soExcStatus | ShowOption.soExcNote
// User
| ShowOption.soUserID | ShowOption.soUserName | ShowOption.soUserEmail | ShowOption.soUserCompany
// Active Controls
| ShowOption.soCmpName | ShowOption.soCmpVideoCard
// Operating System
// Network
| ShowOption.soNetIP | ShowOption.soNetSubmask | ShowOption.soNetGateway | ShowOption.soNetDNS1 | ShowOption.soNetDNS2 | ShowOption.soNetDHCP
// Custom Data
| ShowOption.soCustomData);
// Disable Dialog Options
options.ExceptionDialogOptions -= (ExceptionDialogOptions.edoShowAttachScreenshotOpt ion | ExceptionDialogOptions.edoAttachScreenshotChecked | ExceptionDialogOptions.edoShowInDetailedMode);
Assembly entryAsm = Assembly.GetEntryAssembly();
AssemblyProductAttribute product = ReflectionUtils.GetAttribute<AssemblyProductAttribute>(entryAsm);
options.EMailSendMode = pEMailSendModeSMTPClient ? EmailSendMode.esmSMTPClient : EmailSendMode.esmEmailClient;
options.EMailSubject = String.Format(Properties.Resources.Eurekalog_Email SubjectStructure, product == null ? entryAsm.GetName().Name : product.Product, entryAsm.GetName().Version.ToString());
options.EMailAddresses = pProductMailAddress;
options.SMTPPort = 25;
options.SMTPHost = Constants.SMTPServer;
options.SupportURL = Constants.WebSite;
//set common send options
options.CommonSendOptions -= CommonSendOptions.sndAddComputerNameInFileName | CommonSendOptions.sndAddDateInFileName | CommonSendOptions.sndSendScreenshot | CommonSendOptions.sndSendXMLLogCopy;
if (pEMailSendModeSMTPClient)
{
options.CommonSendOptions |= CommonSendOptions.sndSendInSeparatedThread | CommonSendOptions.sndShowSuccessFailureMsg;
}
else
{
//options.CommonSendOptions -= CommonSendOptions.sndSendInSeparatedThread;
//options.CommonSendOptions -= CommonSendOptions.sndShowSuccessFailureMsg;
}
options.ExceptionDialogType = ExceptionDialogType.edtMSClassic;
options.ExceptionDialogOptions |= ExceptionDialogOptions.edoShowSendErrorReportOptio n | ExceptionDialogOptions.edoSendErrorReportChecked | ExceptionDialogOptions.edoShowCopyToClipOption | ExceptionDialogOptions.edoShowDetailsButton;
// Enable the following Log options:
options.LogOptions |= LogOptions.loDeleteLogAtVersionChange;
}
}
You may need to adjust the out-commented lines of EMailSubject and SMTPHost .
When running this code you will get two Eureklog bugs:
1. the one I reported before: http://news.eurekalog.com/showthread.php?t=2613
2. Call Stack Information:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|System.NullReferenceException - Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|0000029D|EurekaLog|SendHandler.cs |EurekaLogSystem.Dialogs.Main.SendHandler |ProcessOutData() |250[21]|
|00000021|EurekaLog|SendHandler.cs |EurekaLogSystem.Dialogs.Main.SendHandler |SendMessage() |79[13] |
|0000000C|EurekaLog|DialogLauncher.cs |EurekaLogSystem.Dialogs.Main.DialogLauncher |EntireSends() |67[13] |
|00000032|EurekaLog|DialogLauncher.cs |EurekaLogSystem.Dialogs.Main.DialogLauncher |RunSend(ExceptionData exceptData) |59[18] |
|0000007D|EurekaLog|MsDialog.cs |EurekaLogSystem.Dialogs.Main.MsStyle.MSDialog|sen dErrorReport_Click(Object sender, EventArgs e) |195[13]|
|00000019|EurekaLog|System.Windows.Forms.dll|Syste m.Windows.Forms.Control |OnClick(EventArgs e) | |
Greeetings
Harry
it's really sad that the .NET version still that buggy.
We love the Delphi version, but the .NET version is not yet woth using as long as setting all options programmatically doesn't work.
If you get a my simple "ApplStandardSettings" method to run properly for both send modes I guess we will buy the .Net version too:
static class InstallProgram
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(String[] args)
{
EurekaLogSystem.ExceptionHandler.Activate();
InstallProgram.ApplyStandardSettings("est@jam-software.de");
string text = null;
text.Clone();//invoke exception for testing
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
InstallForm eSTInstForm = new InstallForm();
eSTInstForm.DeInstallation = args.Length > 0;
Application.Run(eSTInstForm);
}
/// <summary>
/// Applies the standard settings of JAM-Software products to <see cref="T:EurekaLogSystem.ExceptionHandler"/>.
/// The default EmailSendMode is MailClient. For using SMTPClient as EmailSendMode call <see cref="T:Eurekalog.ApplyStandardSettings(pProductMailAddr ess,true)"/>
/// </summary>
/// <param name="pProductMailAddress">The product mail address.</param>
/// <author> binkle@jam-software.com </author>
public static void ApplyStandardSettings(string pProductMailAddress)
{
ApplyStandardSettings(pProductMailAddress, false);
}
/// <summary>
/// Applies the standard settings of JAM-Software products to <see cref="T:EurekaLogSystem.ExceptionHandler"/>.
/// </summary>
/// <param name="pProductMailAddress">The product mail address.</param>
/// <param name="pEMailSendModeSMTPClient">if set to <c>true</c> [EmailSendMode is SMTPClient] else [EmailSendMode is MailClient (Default)].</param>
/// <author> binkle@jam-software.com </author>
public static void ApplyStandardSettings(string pProductMailAddress, bool pEMailSendModeSMTPClient)
{
EurekaLogOptions options = EurekaLogSystem.ExceptionHandler.CurrentEurekaLogO ptions;
// Disable the following ELF contents: (Commented content stays enabled if enabled in Project options)
options.ShowOptions -= (
// Application
ShowOption.soExcAddress | ShowOption.soExcCount | ShowOption.soExcStatus | ShowOption.soExcNote
// User
| ShowOption.soUserID | ShowOption.soUserName | ShowOption.soUserEmail | ShowOption.soUserCompany
// Active Controls
| ShowOption.soCmpName | ShowOption.soCmpVideoCard
// Operating System
// Network
| ShowOption.soNetIP | ShowOption.soNetSubmask | ShowOption.soNetGateway | ShowOption.soNetDNS1 | ShowOption.soNetDNS2 | ShowOption.soNetDHCP
// Custom Data
| ShowOption.soCustomData);
// Disable Dialog Options
options.ExceptionDialogOptions -= (ExceptionDialogOptions.edoShowAttachScreenshotOpt ion | ExceptionDialogOptions.edoAttachScreenshotChecked | ExceptionDialogOptions.edoShowInDetailedMode);
Assembly entryAsm = Assembly.GetEntryAssembly();
AssemblyProductAttribute product = ReflectionUtils.GetAttribute<AssemblyProductAttribute>(entryAsm);
options.EMailSendMode = pEMailSendModeSMTPClient ? EmailSendMode.esmSMTPClient : EmailSendMode.esmEmailClient;
options.EMailSubject = String.Format(Properties.Resources.Eurekalog_Email SubjectStructure, product == null ? entryAsm.GetName().Name : product.Product, entryAsm.GetName().Version.ToString());
options.EMailAddresses = pProductMailAddress;
options.SMTPPort = 25;
options.SMTPHost = Constants.SMTPServer;
options.SupportURL = Constants.WebSite;
//set common send options
options.CommonSendOptions -= CommonSendOptions.sndAddComputerNameInFileName | CommonSendOptions.sndAddDateInFileName | CommonSendOptions.sndSendScreenshot | CommonSendOptions.sndSendXMLLogCopy;
if (pEMailSendModeSMTPClient)
{
options.CommonSendOptions |= CommonSendOptions.sndSendInSeparatedThread | CommonSendOptions.sndShowSuccessFailureMsg;
}
else
{
//options.CommonSendOptions -= CommonSendOptions.sndSendInSeparatedThread;
//options.CommonSendOptions -= CommonSendOptions.sndShowSuccessFailureMsg;
}
options.ExceptionDialogType = ExceptionDialogType.edtMSClassic;
options.ExceptionDialogOptions |= ExceptionDialogOptions.edoShowSendErrorReportOptio n | ExceptionDialogOptions.edoSendErrorReportChecked | ExceptionDialogOptions.edoShowCopyToClipOption | ExceptionDialogOptions.edoShowDetailsButton;
// Enable the following Log options:
options.LogOptions |= LogOptions.loDeleteLogAtVersionChange;
}
}
You may need to adjust the out-commented lines of EMailSubject and SMTPHost .
When running this code you will get two Eureklog bugs:
1. the one I reported before: http://news.eurekalog.com/showthread.php?t=2613
2. Call Stack Information:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|System.NullReferenceException - Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|0000029D|EurekaLog|SendHandler.cs |EurekaLogSystem.Dialogs.Main.SendHandler |ProcessOutData() |250[21]|
|00000021|EurekaLog|SendHandler.cs |EurekaLogSystem.Dialogs.Main.SendHandler |SendMessage() |79[13] |
|0000000C|EurekaLog|DialogLauncher.cs |EurekaLogSystem.Dialogs.Main.DialogLauncher |EntireSends() |67[13] |
|00000032|EurekaLog|DialogLauncher.cs |EurekaLogSystem.Dialogs.Main.DialogLauncher |RunSend(ExceptionData exceptData) |59[18] |
|0000007D|EurekaLog|MsDialog.cs |EurekaLogSystem.Dialogs.Main.MsStyle.MSDialog|sen dErrorReport_Click(Object sender, EventArgs e) |195[13]|
|00000019|EurekaLog|System.Windows.Forms.dll|Syste m.Windows.Forms.Control |OnClick(EventArgs e) | |
Greeetings
Harry