This error occurs only in some computers. By reading the stack information, there is some problem when I call to this static method ("FormatQuery") in a static class:
using System;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using FlexCel.Report;
using FlexCel.XlsAdapter;
using ComboBox=System.Windows.Forms.ComboBox;
namespace XSoftArt.A
{
static class RHelper
{
private static string FormatQuery(string FieldName, int Count,
CheckedListBox chekedListBox)
{
string ID = string.Empty;
int n = Count;
foreach (DataRowView item in chekedListBox.CheckedItems)
{
ID = ID + item["" + FieldName + ""];
if (n > 1)
{
ID = ID + " , ";
n--;
}
}
return ID;
}
public static string FormatQuery(CheckedListBox chekedListBox)
{
return FormatQuery(chekedListBox.ValueMember,
chekedListBox.CheckedItems.Count, chekedListBox);
}
}
So, what's the problem? How do I solve it? Is there something wrong with the project configuration or debbuging mode or what?
Error information:
at XSoftArt.EVS.ReportHelper.FormatQuery(CheckedListBox chekedListBox)
at XSoftArt.EVS.NewEmailSelectClient.LoadList_v2(String search, TextBox txtbox)
at XSoftArt.EVS.NewEmailSelectClient.LoadContacts()
at XSoftArt.EVS.NewEmailSelectClient.button7_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I got this error when trying to log to an NLog target that no longer existed.
I had the same error but in my case it was caused by mismatch in platform target settings. One library was set specifically to x86 while the main application was set to 'Any'...and then I moved my development to an x64 laptop.
This error was generated for me by having an incorrectly formatted NLog.config file.
This can be caused by not having administrator permissions for
Oracle Client
. Add this inApp.config
file:I had this problem and like Anderson Imes said it had to do with app settings. My problem was the scope of one of my settings was set to "User" when it should have been "Application".