Re: [Mono-dev] Getting error at Runtime

2006-02-10 Thread mike . hull

Javier Ruiz wrote:

I get the following error at runtime from the attached code.
 
ERROR:

Object reference not set to an instance of an object
 
I still don't understand why if I compile the code using VS 2005 and 
run the program on windows it works but if I compile with gmcs and run 
on Linux I get errors.

Is there a stack trace?

ex.ToString() should give you a better idea of what it is.

I think your problem is here:

  string sysdate = (string)dbreader["sysdate"].ToString();

If that dbreader["sysdate"] == null then you'll get a NRE.

Try this:
object sysdate = dbreader["sysdate"];
string sysdate = sysdate == null ? string.Empty : sysdate.ToString();
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Getting error at Runtime

2006-02-10 Thread Javier Ruiz



I get the following 
error at runtime from the attached code.
 
ERROR:
Object reference not 
set to an instance of an object
 
I still don't 
understand why if I compile the code using VS 2005 and run the program on 
windows it works but if I compile with gmcs and run on Linux I get 
errors.
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using System.Data.OracleClient;
using System.Net.Mail;

namespace MontitorDatabase
{
class Program
{
static void Main(string[] args)
{
//Creating connection
string connectionString =
"Data Source=EMREP1;"
+ "User ID=system;"
+ "Password=c0mm0d0r3;";
OracleConnection dbconn = null;
dbconn = new OracleConnection(connectionString);
try
{
dbconn.Open();

OracleCommand dbcmd = dbconn.CreateCommand();
string sql = "select sysdate,status from v$instance";
dbcmd.CommandText = sql;

OracleDataReader dbreader = dbcmd.ExecuteReader();
while (dbreader.Read())
{
string sysdate = (string)dbreader["sysdate"].ToString();
string status = (string)dbreader["status"];
System.Console.WriteLine("Date: {0} Status: {1}", sysdate, 
status);
}
}
catch (OracleException ex)
{
System.Console.WriteLine("Oracle Error - " + ex.Message);
FileStream file = new FileStream("db_montior.txt", 
FileMode.Create, FileAccess.Write);
StreamWriter sw = new StreamWriter(file);
sw.Write(ex.Message);
sw.Close();
 try
 {
MailMessage message = new MailMessage();
message.To.Add("[EMAIL PROTECTED]");
message.Subject = "Oracle Connection Error";
message.From = new MailAddress("[EMAIL PROTECTED]");
message.Body = ex.Message;
SmtpClient smtp = new SmtpClient("grante2k.grantprideco.cc");
smtp.Send(message);
 }
 catch (Exception e)
 {
System.Console.WriteLine("Error from emailer: " + e.Message);
 }



}
finally
{
dbconn.Close();
}
}
}

}
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] LDAP NotImplementedException workaround.

2006-02-10 Thread mike . hull

[EMAIL PROTECTED] wrote:

[EMAIL PROTECTED] wrote:
Attached is a diff to work around Thread.Interrupt() 
NotImplementedException in the Novell.Directory.Ldap library.


I didn't see a place to submit a bug report on Ximian's bugzilla is 
there somewhere on Novell Forge?

Patch was wrong, forgot to add the namespace for Thread.


This one should work.  Sorry about that.

--
Mike Hull
http://www.coversant.net
Index: Novell.Directory.Ldap/Connection.cs
===
--- Novell.Directory.Ldap/Connection.cs (revision 56783)
+++ Novell.Directory.Ldap/Connection.cs (working copy)
@@ -505,6 +505,16 @@
// Keep trying for the 
lock
continue;
}
+   catch 
(System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState 
== SupportClass.ThreadClass.INTERRUPT)
+   {
+   // Keep trying 
for the lock
+   
Thread.ResetAbort();
+   continue;
+   }
+   else throw ex;
+   }
}
}
writeSemaphoreCount++;
@@ -606,6 +616,15 @@
{
;
}
+   catch (System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState == 
SupportClass.ThreadClass.INTERRUPT)
+   {
+   Thread.ResetAbort();
+   }
+   else throw ex;
+   }
+
if(reader!=null)
{
rInst=reader;
@@ -1506,6 +1525,7 @@
{
// Abort has been called on reader
// before closing sockets, from shutdown
+   Thread.ResetAbort();
return;
}
 #if TARGET_JVM
Index: Novell.Directory.Ldap/SupportClass.cs
===
--- Novell.Directory.Ldap/SupportClass.cs   (revision 56783)
+++ Novell.Directory.Ldap/SupportClass.cs   (working copy)
@@ -634,9 +634,10 @@
/// 
/// Interrupts a thread that is in the WaitSleepJoin 
thread state
/// 
+   public const string INTERRUPT = "interrupt";
public virtual void Interrupt()
{
-   threadField.Interrupt();
+   threadField.Abort(INTERRUPT);
}
  
/// 
Index: Novell.Directory.Ldap/Message.cs
===
--- Novell.Directory.Ldap/Message.cs(revision 56783)
+++ Novell.Directory.Ldap/Message.cs(working copy)
@@ -166,6 +166,15 @@
{
; // do nothing
}
+   catch 
(System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState == 
SupportClass.ThreadClass.INTERRUPT)
+   {
+   
System.Threading.Thread.ResetAbort();
+   }
+   else throw ex;
+   }
+
if (waitForReply_Renamed_Field)
{
continue;
@@ -599,6 +608,15 @@
{
// the timer was stopped, do nothing
}
+   catch (System.Threading.ThreadAbortException ex)
+   

Re: [Mono-dev] LDAP NotImplementedException workaround.

2006-02-10 Thread mike . hull

[EMAIL PROTECTED] wrote:
Attached is a diff to work around Thread.Interrupt() 
NotImplementedException in the Novell.Directory.Ldap library.


I didn't see a place to submit a bug report on Ximian's bugzilla is 
there somewhere on Novell Forge?

Patch was wrong, forgot to add the namespace for Thread.

--
Mike Hull
http://www.coversant.net
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] LDAP NotImplementedException workaround.

2006-02-10 Thread mike . hull
Attached is a diff to work around Thread.Interrupt() 
NotImplementedException in the Novell.Directory.Ldap library.


I didn't see a place to submit a bug report on Ximian's bugzilla is 
there somewhere on Novell Forge?


--
Mike Hull
http://www.coversant.net
Index: Novell.Directory.Ldap/Connection.cs
===
--- Novell.Directory.Ldap/Connection.cs (revision 56783)
+++ Novell.Directory.Ldap/Connection.cs (working copy)
@@ -505,6 +505,16 @@
// Keep trying for the 
lock
continue;
}
+   catch 
(System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState 
== SupportClass.ThreadClass.INTERRUPT)
+   {
+   // Keep trying 
for the lock
+   
Thread.ResetAbort();
+   continue;
+   }
+   else throw ex;
+   }
}
}
writeSemaphoreCount++;
@@ -606,6 +616,15 @@
{
;
}
+   catch (System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState == 
SupportClass.ThreadClass.INTERRUPT)
+   {
+   Thread.ResetAbort();
+   }
+   else throw ex;
+   }
+
if(reader!=null)
{
rInst=reader;
@@ -1506,6 +1525,7 @@
{
// Abort has been called on reader
// before closing sockets, from shutdown
+   Thread.ResetAbort();
return;
}
 #if TARGET_JVM
Index: Novell.Directory.Ldap/SupportClass.cs
===
--- Novell.Directory.Ldap/SupportClass.cs   (revision 56783)
+++ Novell.Directory.Ldap/SupportClass.cs   (working copy)
@@ -634,9 +634,10 @@
/// 
/// Interrupts a thread that is in the WaitSleepJoin 
thread state
/// 
+   public const string INTERRUPT = "interrupt";
public virtual void Interrupt()
{
-   threadField.Interrupt();
+   threadField.Abort(INTERRUPT);
}
  
/// 
Index: Novell.Directory.Ldap/Message.cs
===
--- Novell.Directory.Ldap/Message.cs(revision 56783)
+++ Novell.Directory.Ldap/Message.cs(working copy)
@@ -166,6 +166,15 @@
{
; // do nothing
}
+   catch 
(System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState == 
SupportClass.ThreadClass.INTERRUPT)
+   {
+   Thread.ResetAbort();
+   }
+   else throw ex;
+   }
+
if (waitForReply_Renamed_Field)
{
continue;
@@ -599,6 +608,15 @@
{
// the timer was stopped, do nothing
}
+   catch (System.Threading.ThreadAbortException ex)
+   {
+   if (ex.ExceptionState == 
SupportClass.ThreadClass.INTERRUPT)
+ 

Re: [Mono-dev] [PATCH]TraceSource stubs

2006-02-10 Thread joel reed
On Wed, Feb 08, 2006 at 07:48:31AM -0500, Jonathan Pryor wrote:
> On Tue, 2006-02-07 at 22:46 -0500, joel reed wrote:
> > The attached patch adds 3 .Net 2.0 enums and stubs out the 
> > methods and properties for the TraceSource class. I saw some
> > stubbed out classes in the tree which used:



Jonathan, i think i've incorporated all your feedback into
this patch. i only "#if false" the TraceSource class, as the
other files are just enums. i hope that is appropriate.

jr
diff --git a/mcs/class/System/System.Diagnostics/SourceLevels.cs 
b/mcs/class/System/System.Diagnostics/SourceLevels.cs
new file mode 100644
index 000..42ad8b9
--- /dev/null
+++ b/mcs/class/System/System.Diagnostics/SourceLevels.cs
@@ -0,0 +1,45 @@
+// SourceLevels.cs
+// Authors:
+//   Joel Reed ([EMAIL PROTECTED])
+//
+// Copyright (C) 2006 Joel Reed
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System.Diagnostics {
+
+   [FlagsAttribute]
+   public enum SourceLevels {
+   ActivityTracing= 0,
+   All = 1,
+   Critical = 2,
+   Error = 4,
+   Information = 8,
+   Off = 16,
+   Verbose = 32,
+   Warning = 64
+   }
+
+}
+
+#endif
diff --git a/mcs/class/System/System.Diagnostics/TraceEventType.cs 
b/mcs/class/System/System.Diagnostics/TraceEventType.cs
new file mode 100644
index 000..d082361
--- /dev/null
+++ b/mcs/class/System/System.Diagnostics/TraceEventType.cs
@@ -0,0 +1,46 @@
+// TraceEventType.cs
+// Authors:
+//   Joel Reed ([EMAIL PROTECTED])
+//
+// Copyright (C) 2006 Joel Reed
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+#if NET_2_0
+
+namespace System.Diagnostics {
+
+   public enum TraceEventType {
+   CriticalFatal = 0,
+   Error = 1,
+   Information = 2,
+   Resume = 3,
+   Start = 4,
+   Stop = 5,
+   Suspend = 6,
+   Transfer = 7,
+   Verbose = 8,
+   Warning = 9
+   } // TraceEventType
+
+} // System.Diagnostics
+
+#endif
diff --git a/mcs/class/System/System.Diagnostics/TraceOptions.cs 
b/mcs/class/System/System.Diagnostics/TraceOptions.cs
new file mode 100644
index 000..2b4397f
--- /dev/null
+++ b/mcs/class/System/System.Diagnostics/TraceOptions.cs
@@ -0,0 +1,44 @@
+// TraceOptions.cs
+// Authors:
+//   Joel Reed ([EMAIL PROTECTED])
+//
+// Copyright (C) 2006 Joel Reed
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished

RE: [Mono-dev] Issue Compiling on Red Hat Linux

2006-02-10 Thread Javier Ruiz



That worked thanks I know why it was working on Windows 
because I had no connection to the database.


From: JD Conley [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 10, 2006 6:11 PMTo: Javier Ruiz; 
Jonel Rienton; mono-devel-list@lists.ximian.comSubject: RE: 
[Mono-dev] Issue Compiling on Red Hat Linux


I’d guess this is the 
problem:
 
    
string sysdate = (string)dbreader["sysdate"];
 
Use 
dbreader["sysdate"].ToString() or Convert.ToString(dbreader["sysdate"]). If 
sysdate was a Date value in your DB it won’t directly cast to a string. You need 
to do a conversion.
 
-JD 
Conley
 





From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Javier RuizSent: Friday, February 10, 2006 3:23 
PMTo: 'Jonel Rienton'; 
mono-devel-list@lists.ximian.comSubject: RE: [Mono-dev] Issue Compiling on 
Red Hat Linux
 
That would help sorry 
here is the code.
 



From: Jonel 
Rienton [mailto:[EMAIL PROTECTED] Sent: Friday, February 10, 2006 4:20 
PMTo: 'Javier Ruiz'; 
mono-devel-list@lists.ximian.comSubject: RE: [Mono-dev] Issue Compiling on 
Red Hat Linux
hard to help without 
seeing any code
 



From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Javier RuizSent: Friday, February 10, 2006 4:08 
PMTo: 
mono-devel-list@lists.ximian.comSubject: [Mono-dev] Issue Compiling on Red 
Hat Linux

I'm running mono and I compile my 
program ok but when I run the program I get the following error. I can run the 
program on windows with no problems.

 

ERROR:

Unhandled Exception: 
System.InvalidCastExeception: Cannot cast from source type to destination 
type.

 

Javier 
Ruiz

Oracle 
DBA
 
--No 
virus found in this incoming message.Checked by AVG Free 
Edition.Version: 7.1.375 / Virus Database: 267.15.4/255 - Release Date: 
2/9/2006
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] error CS0277 using "protected set"

2006-02-10 Thread Marek Safar

Hello Jonathan,

Please report this as Mono C# compiler bug.

Thanks,
Marek


When compiling the attached file, I get the following compilation
error (using mono 1.1.13):

error CS0277: Accessor `ProtectedSetter.DerivedClass.Name.set' must be
declared public to implement interface member
`ProtectedSetter.BaseClass.Name.set'

Is this a bug in the Mono compiler?

Thanks,
Jonathan
  



___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
  


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] Issue Compiling on Red Hat Linux

2006-02-10 Thread JD Conley








I’d guess this is the problem:

 

    string sysdate =
(string)dbreader["sysdate"];

 

Use dbreader["sysdate"].ToString()
or Convert.ToString(dbreader["sysdate"]). If sysdate was a Date value
in your DB it won’t directly cast to a string. You need to do a
conversion.

 

-JD Conley

 











From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Javier Ruiz
Sent: Friday, February 10, 2006
3:23 PM
To: 'Jonel Rienton';
mono-devel-list@lists.ximian.com
Subject: RE: [Mono-dev] Issue
Compiling on Red Hat Linux



 

That would help sorry here is the code.

 







From: Jonel
Rienton [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 10, 2006
4:20 PM
To: 'Javier Ruiz';
mono-devel-list@lists.ximian.com
Subject: RE: [Mono-dev] Issue Compiling
on Red Hat Linux

hard to help without seeing any code

 







From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Javier Ruiz
Sent: Friday, February 10, 2006
4:08 PM
To: mono-devel-list@lists.ximian.com
Subject: [Mono-dev] Issue
Compiling on Red Hat Linux



I'm running mono and I compile my program ok but when I run
the program I get the following error. I can run the program on windows with no
problems.





 





ERROR:





Unhandled Exception: System.InvalidCastExeception: Cannot
cast from source type to destination type.





 





Javier Ruiz





Oracle DBA



 

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.375 / Virus Database: 267.15.4/255 - Release Date: 2/9/2006








___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] Issue Compiling on Red Hat Linux

2006-02-10 Thread Javier Ruiz



That would help sorry here is the 
code.


From: Jonel Rienton 
[mailto:[EMAIL PROTECTED] Sent: Friday, February 10, 2006 4:20 
PMTo: 'Javier Ruiz'; 
mono-devel-list@lists.ximian.comSubject: RE: [Mono-dev] Issue 
Compiling on Red Hat Linux

hard to help without seeing any 
code


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Javier 
RuizSent: Friday, February 10, 2006 4:08 PMTo: 
mono-devel-list@lists.ximian.comSubject: [Mono-dev] Issue Compiling 
on Red Hat Linux

I'm running mono and 
I compile my program ok but when I run the program I get the following error. I 
can run the program on windows with no problems.
 
ERROR:
Unhandled Exception: 
System.InvalidCastExeception: Cannot cast from source type to destination 
type.
 
Javier 
Ruiz
Oracle 
DBA
--No virus found in this incoming message.Checked by AVG 
Free Edition.Version: 7.1.375 / Virus Database: 267.15.4/255 - Release Date: 
2/9/2006

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Data;
using System.Data.OracleClient;
using System.Net.Mail;

namespace MontitorDatabase
{
class Program
{
static void Main(string[] args)
{
//Creating connection
string connectionString =
"Data Source=EMREP;"
+ "User ID=system;"
+ "Password=c0mm0d0r3;";
OracleConnection dbconn = null;
dbconn = new OracleConnection(connectionString);
try
{
dbconn.Open();

OracleCommand dbcmd = dbconn.CreateCommand();
string sql = "select sysdate,status from v$instance";
dbcmd.CommandText = sql;

OracleDataReader dbreader = dbcmd.ExecuteReader();
while (dbreader.Read())
{
string sysdate = (string)dbreader["sysdate"];
string status = (string)dbreader["status"];
System.Console.WriteLine("Date: {0} Status: {1}", sysdate, 
status);
}
}
catch (NullReferenceException ex)
{
   // System.Console.WriteLine(ex.Message);
   // FileStream file = new FileStream("db_montior.txt", 
FileMode.Create, FileAccess.Write);
   // StreamWriter sw = new StreamWriter(file);
   // sw.Write(ex.Message);
   // sw.Close();
   // System.Net.Mail.MailMessage message = new 
System.Net.Mail.MailMessage();
   // message.To.Add("[EMAIL PROTECTED];javierruiz@");
   // message.Subject = "Test C# Mail";
   // message.From = new System.Net.Mail.MailAddress("[EMAIL 
PROTECTED]");
   // message.Body = ex.Message;
   // System.Net.Mail.SmtpClient smtp = new 
System.Net.Mail.SmtpClient("grante2k.grantprideco.cc");
   // smtp.Send(message);


}
finally
{
dbconn.Close();
}
}
}

}
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] Issue Compiling on Red Hat Linux

2006-02-10 Thread Jonel Rienton



hard to help without seeing any 
code


From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Javier 
RuizSent: Friday, February 10, 2006 4:08 PMTo: 
mono-devel-list@lists.ximian.comSubject: [Mono-dev] Issue Compiling 
on Red Hat Linux

I'm running mono and 
I compile my program ok but when I run the program I get the following error. I 
can run the program on windows with no problems.
 
ERROR:
Unhandled Exception: 
System.InvalidCastExeception: Cannot cast from source type to destination 
type.
 
Javier 
Ruiz
Oracle 
DBA
--No virus found in this incoming message.Checked by AVG 
Free Edition.Version: 7.1.375 / Virus Database: 267.15.4/255 - Release Date: 
2/9/2006

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Issue Compiling on Red Hat Linux

2006-02-10 Thread Javier Ruiz



I'm running mono and 
I compile my program ok but when I run the program I get the following error. I 
can run the program on windows with no problems.
 
ERROR:
Unhandled Exception: 
System.InvalidCastExeception: Cannot cast from source type to destination 
type.
 
Javier 
Ruiz
Oracle 
DBA
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] StreamReader ReadLine Issue

2006-02-10 Thread Mike Glenn
Hello all,

I've run into an issue with StreamReader.ReadLine() and differences in MS.Net
implementation. Here's the basics of it:

While reading messages from a pop server I encountered a message that had some
improper formatting that looked like this (using escapes to show the data stream
as it was past to me):

From: [EMAIL PROTECTED]
Subject: Something that you don't care about\r\r\n
X-SomeHeader: blah blah blah\r\n
\r\n
some message body\r
some more\r\n
\r\n
.\r\n

If you note on the subject line there are 2 \r's mono returns the subject line
and on the next call returns an empty line. MS returns the subject line and on
the following call returns the X-Header line. This behavior causes my code to
see the end of the headers and the beginning of the body as rfc822 specs out.
This of course is wrong and things really go down hill when I see the body line
with only the \r.

The attached patch, against mcs, changes how StreamReader.FindNextEOL()
functions to deal with things correctly for me. I'm not sure that it's the best
way or even the correct way to solve this, but I hope it at least gives enough
info to create a unit test for this kind of thing and deal with it properly.

Mike Glenn


StreamReader_EOL.patch
Description: Binary data
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] MacOS Mono can't find DLL problem

2006-02-10 Thread Alex Chudnovsky

Hi

I am trying to use software that runs okay under Linux and FreeBSD's 
Mono on Mac OS using Mono v1.1.13.2.


Unfortunately it refuses to run due to  System.DllNotFoundException: 
libsqlite3.0.dylib - this is SQLite 3. Under Linux I keep the file 
either named sqlite3 or sqlite3.dll and it all works, I renamed it to be 
libsqlite3.0.dylib and still its not found under Mac OS 10.3.9 (Darwin I 
think).


To be sure I set and exported the following env vars with path to the 
directory where software with libsqlite3.0.dylib resides: 
DYLD_LIBRARY_PATH and LD_LIBRARY_PATH


Nothing helps however - that DLL is still not found, the question is 
what else am I missing?!?!


cheers

Alex
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Please, share your .Net1.1 and 2.0 support and #if directives experience

2006-02-10 Thread mike . hull

Francisco Figueiredo Jr. wrote:

Npgsql developers are going to start adding 2.0 functionality and
interfaces to Npgsql.

We discussed about it and we decided to have another directory in Npgsql
cvs tree to hold the new Npgsql2 source code.

I'd like to hear from you what are your experience with usage of #if in
the source code. We thought it could confuse and make a lot of noise in
the code. One of the developers even started to code with #if's but quit
because it was too confusing and difficult to maintain.

I'm also asking that because I know Mono has a dual (or triple if we
consider 1.0) compilation process in same code and Npgsql2 would
eventually be put in Mono svn tree. If we keep a separated Npgsql2
directory, would it be a problem?
  


We followed the same practices as are observed in the mono source code. 

We use Visual Studio 2005 as a development environment.  We can target 
different versions of mono and also different versions of the .NET 
framework.  Attached is the latest version of the targets file that we 
use. 

If you search the archives of this list I have posted previously 
instructions on how to use it.


--
Mike Hull
http://www.coversant.net








  
C:\program 
files\Mono-1.1.13.2\lib\mono\2.0\

  
C:\program files\Mono-1.1.13.2\lib\mono\2.0\
  

  
C:\program files\Mono-1.1.10\lib\mono\2.0\
  
  
C:\program files\Mono-1.1.10\lib\mono\2.0\
  

  
C:\program files\Mono-1.1.10\lib\mono\2.0\
  
  
C:\program files\Mono-1.1.10\lib\mono\2.0\
  

  

true
full
false
bin\Linux\Debug\
DEBUG;TRACE

$(DefineConstants);STANDARD_FRAMEWORK;MONO;LINUX;NET_2_0;MONO_1_1_10

4
false
true

CoversantStrongName
True



pdbonly
true
bin\Linux\Release\
TRACE

$(DefineConstants);STANDARD_FRAMEWORK;MONO;LINUX;NET_2_0;MONO_1_1_10

4
false
true

CoversantStrongName
True




  
  
true
full
false
bin\Linux 
1.1.13\Debug\
DEBUG;TRACE

$(DefineConstants);STANDARD_FRAMEWORK;MONO;LINUX;NET_2_0;MONO_1_1_13

4
false
true
CoversantStrongName
True
  

  
pdbonly
true
bin\Linux 
1.1.13\Release\
TRACE

$(DefineConstants);STANDARD_FRAMEWORK;MONO;LINUX;NET_2_0;MONO_1_1_13

4
false
true
CoversantStrongName
True

  
  


  

true
full
false
bin\Mono 
2.0\Debug\
DEBUG;TRACE

$(DefineConstants);STANDARD_FRAMEWORK;MONO;NET_2_0

4
false
true

CoversantStrongName
True




pdbonly
true
bin\Mono 
2.0\Release\
MONO;TRACE

$(DefineConstants);STANDARD_FRAMEWORK;MONO;NET_2_0

4
false
true

CoversantStrongName
True







true
full
false
bin\Debug\
DEBUG;TRACE

$(DefineConstants);STANDARD_FRAMEWORK;NET_2_0;MS_NET_2_0
prompt
4
True


pdbonly
true
bin\Release\
TRACE

$(DefineConstants);STANDARD_FRAMEWORK;NET_2_0;MS_NET_2_0
prompt
4
True






mscorlib
$(MonoPath)



  

  mscorlib
  $(MonoPath)

  

  

  mscorlib
  $(MonoPath)

  
  






$(AvailablePlatforms),Linux,Linux 
1.1.13,Mono 2.0

{CandidateAssemblyFiles};
$(ReferencePath);
{HintPathFromItem};
{TargetFrameworkDirectory};
{AssemblyFolders};
$(OutputPath);
{GAC}


$(MonoPath)
 




false



  








___
Mono-devel-list maili

Re: [Mono-dev] Please, share your .Net1.1 and 2.0 support and #if directives experience

2006-02-10 Thread Rodrigo B. de Oliveira
On 2/10/06, Francisco Figueiredo Jr. <[EMAIL PROTECTED]> wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
>
>
> Hi all,
>

Hey!

> Npgsql developers are going to start adding 2.0 functionality and
> interfaces to Npgsql.
>
> We discussed about it and we decided to have another directory in Npgsql
> cvs tree to hold the new Npgsql2 source code.
>
> I'd like to hear from you what are your experience with usage of #if in
> the source code.
> ...

We've been using #if directives with success for some time now for the
db4o code base. The main benefit is that the code is always where you
expect it to be.

For complex scenarios we use a mix of partial classes and #if
directives, for instance:

// Baz.cs
namespace Foo.Bar
{
#if NET_2_0
partial
#endif
class Baz
{
 ... // code for all platforms goes here
}
}

// Baz_2.cs
namespace Foo.Bar
{
#if NET_2_0
partial class Baz
{
   // Net 2 specific code here
}
#endif
}

I would recommend against using #if directives inside a method body,
it's much better to have two versions of the method using 'Extract
Method' as appropriate to share functionality.

Rodrigo

PS: E aê, Chicão??!!! :)
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


RE: [Mono-dev] RE: Hi Mono People + Mono Users

2006-02-10 Thread Yogendra Thakur
You can subscribe to mailing list [EMAIL PROTECTED] 
This is for mono user.

-YoGi

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Miguel de
Icaza
Sent: Thursday, February 09, 2006 8:22 PM
To: Aaron Oxford
Cc: mono-devel-list@lists.ximian.com
Subject: Re: [Mono-dev] RE: Hi Mono People + Mono Users

Hello,

> Where can I find a bunch of Mono users? I know that Mono is only
young, but 
> where are they? Is there another mailing list like this one for
general 
> users and discussions? (I'm finding that this one is mainly about 
> developing Mono itself.)

Here are some resources:

http://www.mono-project.com/Related_Mono_Sites

Miguel
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Please, share your .Net1.1 and 2.0 support and #if directives experience

2006-02-10 Thread Francisco Figueiredo Jr.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1



Hi all,

Npgsql developers are going to start adding 2.0 functionality and
interfaces to Npgsql.

We discussed about it and we decided to have another directory in Npgsql
cvs tree to hold the new Npgsql2 source code.

I'd like to hear from you what are your experience with usage of #if in
the source code. We thought it could confuse and make a lot of noise in
the code. One of the developers even started to code with #if's but quit
because it was too confusing and difficult to maintain.

I'm also asking that because I know Mono has a dual (or triple if we
consider 1.0) compilation process in same code and Npgsql2 would
eventually be put in Mono svn tree. If we keep a separated Npgsql2
directory, would it be a problem?


Thanks in advance.

- --
Regards,

Francisco Figueiredo Jr.
http://fxjr.blogspot.com
Npgsql Lead Developer
http://www.pgfoundry.org/projects/npgsql
MonoBrasil Project Founder Member
http://monobrasil.softwarelivre.org


- -
"Science without religion is lame;
religion without science is blind."

  ~ Albert Einstein
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQEVAwUBQ+yT+/7iFmsNzeXfAQIzUgf+KPQMhY4Fk5di4skPIbU2MNkd08V03dZI
oUKHATHp+B6RiHA7qI+3wkncb7H9iIYxz9wyQIHgDLtxn07hJ4ADt3ADSXL77kj/
PiJV7YFswXpOnA0z2avmBKWshSX/oRnhRrmG2HL8mV6Cvy5ULLD+JWyGh0iuSF4o
NNVh9zon91CT7h/c6ua9ng4jhFRo+4csmDzpyYaEMskkhwMqFXMQFb4M36mbUHMj
teX0D5OW+iNbqQZLXl+ofqWikHO3YLIn0v1hvzrTjgF/DBOuhz6IsFxrcKhyPb6B
VRSnSQkYCFL1WaDVeKIH03PMt58LWOTk17kW4T7DxUeOaBWlBiUE9w==
=QXc4
-END PGP SIGNATURE-


___
Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora!
http://br.acesso.yahoo.com
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] System.Net.Sockets completeness

2006-02-10 Thread Dick Porter
On Thu, 2006-02-09 at 08:03 +, Vladimir Lushnikov wrote:
> Hello,
> 
> I have been trying to port one of my network libraries to Mono, and
> have encountered some (minor) incompleteness in the Socket class and
> the new asynchronous resolve methods seen in .NET 2.0

We're slowly filling in the new 2.0 API, but if anyone wants to
take on a particular class feel free.

The class status pages at
http://www.mono-project.com/Resources#API_completion_status_pages will
show what needs to be done.

- Dick


___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


[Mono-dev] Compilation failed in System.Net

2006-02-10 Thread Rachman Chavik
Hi,

I am playing around with Mono and using monoupdater.sh and have
successfully built mono in this machine.

Today, I ran:

monoupdater.sh download
monoupdate.sh build

Compilation failed with the following error messages:

make all-local
make[8]: Entering directory
`/data2/userdata/rachman/monostuff/mcs/class/System'
MONO_PATH="../../class/lib/net_2_0:$MONO_PATH"
/home/users/rachman/work/monostuff/mono/runtime/mono-wrapper
../../gmcs/gmcs.exe /codepage:28591   -d:NET_1_1 -d:NET_2_0 -debug
/noconfig -nowarn:618 -d:CONFIGURATION_2_0 /define:XML_DEP
/r:System.Xml.dll /define:SECURITY_DEP -r:Mono.Security.dll
/define:CONFIGURATION_DEP /r:System.Configuration.dll
/r:PrebuiltSystem=../../class/lib/net_2_0/System.dll -target:library
-out:System.dll  @System.dll.sources
System.Collections.Specialized/IOrderedDictionary.cs(35,25): warning
CS0108:
`System.Collections.Specialized.IOrderedDictionary.GetEnumerator()'
hides inherited member `System.Collections.IEnumerable.GetEnumerator()'.
Use the new keyword if hiding was intended
/data2/userdata/rachman/monostuff/mcs/class/lib/net_2_0/mscorlib.dll:
`System.Collections.IEnumerable.GetEnumerator()', name of symbol related
to previous warning
System.Configuration/SettingElementCollection.cs(81,54): error CS0507:
`System.Configuration.SettingElementCollection.CollectionType.get':
cannot change access modifiers when overriding `protected' inherited
member
`System.Configuration.ConfigurationElementCollection.CollectionType.get'
/data2/userdata/rachman/monostuff/mcs/class/lib/net_2_0/System.Configuration.dll:
`System.Configuration.ConfigurationElementCollection.CollectionType',
name of symbol related to previous error
System.Configuration/SettingElementCollection.cs(81,54): error CS0507:
`System.Configuration.SettingElementCollection.CollectionType': cannot
change access modifiers when overriding `protected' inherited member
`System.Configuration.ConfigurationElementCollection.CollectionType'
/data2/userdata/rachman/monostuff/mcs/class/lib/net_2_0/System.Configuration.dll:
`System.Configuration.ConfigurationElementCollection.CollectionType',
name of symbol related to previous error
System.Net.Sockets/NetworkStream.cs(209,26): warning CS0114:
`System.Net.Sockets.NetworkStream.Dispose(bool)' hides inherited member
`System.IO.Stream.Dispose(bool)'. To make the current member override
that implementation, add the override keyword. Otherwise add the new keyword
/data2/userdata/rachman/monostuff/mcs/class/lib/net_2_0/mscorlib.dll:
`System.IO.Stream.Dispose(bool)', name of symbol related to previous warning
System.Net/FtpDataStream.cs(233,8): warning CS0114:
`System.Net.FtpDataStream.Dispose(bool)' hides inherited member
`System.IO.Stream.Dispose(bool)'. To make the current member override
that implementation, add the override keyword. Otherwise add the new keyword
/data2/userdata/rachman/monostuff/mcs/class/lib/net_2_0/mscorlib.dll:
`System.IO.Stream.Dispose(bool)', name of symbol related to previous warning
Compilation failed: 2 error(s), 3 warnings



Machine Details:
[EMAIL PROTECTED] $ cat /etc/SuSE-release
SuSE Linux 9.3 (i586)
VERSION = 9.3

[EMAIL PROTECTED] $ which mono
/usr/bin/mono

[EMAIL PROTECTED] $ /usr/bin/mono --version
Mono JIT compiler version 1.1.13, (C) 2002-2005 Novell, Inc and
Contributors. www.mono-project.com
TLS:   __thread
GC:Included Boehm (with typed GC)
SIGSEGV  : normal

What am I doing wrong?

-- 
Rachman Chavik
email: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
email: [EMAIL PROTECTED]
www: http://www.chavik.com
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list