Woops, little edit for the above post, NM_DBLCLK is for ListViews. (if you ever make the switch from the ListBox)
You can use
LBN_DBLCLK, however, for the listbox.
By the way, is there a reason the "Visual C# Command Line Compiler" is launched when the program is exited? (csc.exe) (This may, of course, just be normal operation - but I didn't check what debugging options were set either.)
Note: If I don't ask the question of why the program is running another program, I'm sure someone else will - best to just get it out in the open ASAP.
Edit: Doesn't happen with my C# programs from either debug or release. *shrugs*Edit 2: if csc.exe is denied from opening, an Unhandled Exception will occur:
System.BadImageFormatException: Could not load file or assembly '0 bytes loaded from System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. An attempt was made to load a program with an incorrect format.
Edit 3: used processmonitor to get the command-line called:
"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\csc.exe" /noconfig /fullpaths @"C:\Documents and Settings\*CURRENT USER*\Local Settings\Temp\mnpidl0c.cmdline"
Edit 4: and the cmdline file contains:
/t:library /utf8output /R:"C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll" /R:"C:\WINDOWS\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll" /out:"C:\Documents and Settings\*CURRENT USER*\Local Settings\Temp\mnpidl0c.dll" /debug- /optimize+ /nostdlib /D:_DYNAMIC_XMLSERIALIZER_COMPILATION "C:\Documents and Settings\*CURRENT USER*\Local Settings\Temp\mnpidl0c.0.cs"
Edit 5: and the CS (C#) file contains:
#if _DYNAMIC_XMLSERIALIZER_COMPILATION
[assembly:System.Security.AllowPartiallyTrustedCallers()]
[assembly:System.Security.SecurityTransparent()]
#endif
[assembly:System.Reflection.AssemblyVersionAttribute("2.0.0.0")]
namespace Microsoft.Xml.Serialization.GeneratedAssembly {
public class XmlSerializationWriterList1 : System.Xml.Serialization.XmlSerializationWriter {
public void Write1_ArrayOfString(object o) {
WriteStartDocument();
if (o == null) {
WriteNullTagLiteral(@"ArrayOfString", @"");
return;
}
TopLevelElement();
{
global::System.Collections.Generic.List<global::System.String> a = (global::System.Collections.Generic.List<global::System.String>)((global::System.Collections.Generic.List<global::System.String>)o);
if ((object)(a) == null) {
WriteNullTagLiteral(@"ArrayOfString", @"");
}
else {
WriteStartElement(@"ArrayOfString", @"", null, false);
for (int ia = 0; ia < ((System.Collections.ICollection)a).Count; ia++) {
WriteNullableStringLiteral(@"string", @"", ((global::System.String)a[ia]));
}
WriteEndElement();
}
}
}
protected override void InitCallbacks() {
}
}
public class XmlSerializationReaderList1 : System.Xml.Serialization.XmlSerializationReader {
public object Read1_ArrayOfString() {
object o = null;
Reader.MoveToContent();
if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
if (((object) Reader.LocalName == (object)id1_ArrayOfString && (object) Reader.NamespaceURI == (object)id2_Item)) {
if (!ReadNull()) {
if ((object)(o) == null) o = new global::System.Collections.Generic.List<global::System.String>();
global::System.Collections.Generic.List<global::System.String> a_0_0 = (global::System.Collections.Generic.List<global::System.String>)o;
if ((Reader.IsEmptyElement)) {
Reader.Skip();
}
else {
Reader.ReadStartElement();
Reader.MoveToContent();
int whileIterations0 = 0;
int readerCount0 = ReaderCount;
while (Reader.NodeType != System.Xml.XmlNodeType.EndElement && Reader.NodeType != System.Xml.XmlNodeType.None) {
if (Reader.NodeType == System.Xml.XmlNodeType.Element) {
if (((object) Reader.LocalName == (object)id3_string && (object) Reader.NamespaceURI == (object)id2_Item)) {
if (ReadNull()) {
a_0_0.Add(null);
}
else {
a_0_0.Add(Reader.ReadElementString());
}
}
else {
UnknownNode(null, @":string");
}
}
else {
UnknownNode(null, @":string");
}
Reader.MoveToContent();
CheckReaderCount(ref whileIterations0, ref readerCount0);
}
ReadEndElement();
}
}
else {
if ((object)(o) == null) o = new global::System.Collections.Generic.List<global::System.String>();
global::System.Collections.Generic.List<global::System.String> a_0_0 = (global::System.Collections.Generic.List<global::System.String>)o;
}
}
else {
throw CreateUnknownNodeException();
}
}
else {
UnknownNode(null, @":ArrayOfString");
}
return (object)o;
}
protected override void InitCallbacks() {
}
string id3_string;
string id1_ArrayOfString;
string id2_Item;
protected override void InitIDs() {
id3_string = Reader.NameTable.Add(@"string");
id1_ArrayOfString = Reader.NameTable.Add(@"ArrayOfString");
id2_Item = Reader.NameTable.Add(@"");
}
}
public abstract class XmlSerializer1 : System.Xml.Serialization.XmlSerializer {
protected override System.Xml.Serialization.XmlSerializationReader CreateReader() {
return new XmlSerializationReaderList1();
}
protected override System.Xml.Serialization.XmlSerializationWriter CreateWriter() {
return new XmlSerializationWriterList1();
}
}
public sealed class ListOfStringSerializer : XmlSerializer1 {
public override System.Boolean CanDeserialize(System.Xml.XmlReader xmlReader) {
return xmlReader.IsStartElement(@"ArrayOfString", @"");
}
protected override void Serialize(object objectToSerialize, System.Xml.Serialization.XmlSerializationWriter writer) {
((XmlSerializationWriterList1)writer).Write1_ArrayOfString(objectToSerialize);
}
protected override object Deserialize(System.Xml.Serialization.XmlSerializationReader reader) {
return ((XmlSerializationReaderList1)reader).Read1_ArrayOfString();
}
}
public class XmlSerializerContract : global::System.Xml.Serialization.XmlSerializerImplementation {
public override global::System.Xml.Serialization.XmlSerializationReader Reader { get { return new XmlSerializationReaderList1(); } }
public override global::System.Xml.Serialization.XmlSerializationWriter Writer { get { return new XmlSerializationWriterList1(); } }
System.Collections.Hashtable readMethods = null;
public override System.Collections.Hashtable ReadMethods {
get {
if (readMethods == null) {
System.Collections.Hashtable _tmp = new System.Collections.Hashtable();
_tmp[@"System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]::"] = @"Read1_ArrayOfString";
if (readMethods == null) readMethods = _tmp;
}
return readMethods;
}
}
System.Collections.Hashtable writeMethods = null;
public override System.Collections.Hashtable WriteMethods {
get {
if (writeMethods == null) {
System.Collections.Hashtable _tmp = new System.Collections.Hashtable();
_tmp[@"System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]::"] = @"Write1_ArrayOfString";
if (writeMethods == null) writeMethods = _tmp;
}
return writeMethods;
}
}
System.Collections.Hashtable typedSerializers = null;
public override System.Collections.Hashtable TypedSerializers {
get {
if (typedSerializers == null) {
System.Collections.Hashtable _tmp = new System.Collections.Hashtable();
_tmp.Add(@"System.Collections.Generic.List`1[[System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]::", new ListOfStringSerializer());
if (typedSerializers == null) typedSerializers = _tmp;
}
return typedSerializers;
}
}
public override System.Boolean CanSerialize(System.Type type) {
return false;
}
public override System.Xml.Serialization.XmlSerializer GetSerializer(System.Type type) {
return null;
}
}
}
Edit 6: Seems to be related to the XML load/save of the ignorelist on program start/close, but I'm still not sure why a separate DLL has to be built just to accomplish that.
Edit 7:
The XMLSerializer class performs dynamical compilation. During dynamical compilation, the Csc.exe process is started.
Thread on a similar problemEdit 8: after some research I found out that you can, if you want, compile a non-standard serialization DLL for your specific program to save the time spent compiling on-the-fly every time you want to save the ignorelist. (see
here for an article)