RE: [Mono-list] Abstract classes...

2004-05-28 Thread Robert Remen
Hi!

The implementation of mono compiler is wrong. If you have a mix of
non-override and override overloads in a class, then the non-override
overload must take precedence (at compile time).

>From the C# Language Specification:

- in section 7.4.2:

"For example, the set of candidates for a method invocation does not
include methods marked override (Section 7.3), and methods in a base
class are not candidates if any method in a derived class is applicable
(Section 7.5.5.1)."

-in section 7.5.5.1:

"The intuitive effect of the resolution rules described above is as
follows: To locate the particular method invoked by a method invocation,
start with the type indicated by the method invocation and proceed up
the inheritance chain until at least one applicable, accessible,
non-override method declaration is found. Then perform overload
resolution on the set of applicable, accessible, non-override methods
declared in that type and invoke the method thus selected."

Robert



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of vguzev
Sent: Donnerstag, 27. Mai 2004 17:39
To: [EMAIL PROTECTED]
Subject: [Mono-list] Abstract classes...

Hello!


I've found some differences between MS .Net and Mono behaviour.

Here's a little example (from RSDN forum):
8<-
using System;

namespace TestMethods
{
 class Class1
 {
  static void Main(string[] args)
  {
   TestClass testClass = new TestClass();
   testClass.AddItem("", new TestParam());
   testClass.AddItem("", new ParamClass());

   BaseClass baseClass = testClass as BaseClass;
   baseClass.AddItem("", new TestParam());
   baseClass.AddItem("", new ParamClass());
  }
 }

 public class ParamClass {}

 public class TestParam : ParamClass {}

 public abstract class BaseClass
 {
  public abstract void AddItem(String name, ParamClass val);  }

 public class TestClass : BaseClass
 {
  public void AddItem(String name, Object val)
  {
   Console.WriteLine("Method with 'Object val' called");
  }

  public override void AddItem(String name, ParamClass val)
  {
   Console.WriteLine("Method with 'ParamClass val' called");
  }
 }
}
8<-

MS.Net prints the following:
8<-
Method with 'Object val' called
Method with 'Object val' called
Method with 'ParamClass val' called
Method with 'ParamClass val' called
8<-

Mono prints:
8<-
Method with 'ParamClass val' called
Method with 'ParamClass val' called
Method with 'ParamClass val' called
Method with 'ParamClass val' called
8<-

Who is right? Mono or MS .Net?


Best regards,
Vadim B. Guzev
http://u.pereslavl.ru/~vadim/MCSharp/
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] A couple of Remoting Questions

2004-05-12 Thread Robert Remen
Hi,

1) You do not need a configuration file, but you must somehow configure
the remoting inside your application. You have two options:
- Call RemotingConfiguration.Configure(). You can use null as the
filename parameter. Passing a null reference as the filename parameter
will cause default remoting initialization without requiring the
existence of a configuration file.
Example: "RemotingConfiguration.Configure(null);"
- Call at least ChannelServices.RegisterChannel() passing as a parameter
an instance of channel class (in your case HttpChannel Class). You do
not need to define the port on the client side.
Example: "ChannelServices.RegisterChannel(new HttpChannel());"

2) I have RH9 with mono beta 1 installed. I have run your app for about
30 times (and also my own apps many times in past), but never seen such
a strange behavior... Everything works nice and clean, no asserts, no
left behind processes. I have no idea what's wrong.

3) Here ist the soap specification http://www.w3.org/TR/soap/ and here
http://msdn.microsoft.com/library/en-us/dnsoap/html/understandsoap.asp
an article from microsoft regarding soap (with good examples).

Robert

-Original Message-
From: Jonathan Stowe [mailto:[EMAIL PROTECTED] 
Sent: Montag, 10. Mai 2004 14:21
To: Mono-List
Subject: [Mono-list] A couple of Remoting Questions

I have been playing around with remoting and a couple of things have
come up

I am trying a test based in the example in MS SDK:

Client:

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

namespace RemotingTest
{
  public class Client
  {
public static void Main(string [] args)
{
  RemotingConfiguration.Configure("remoting.config");
  HelloServer obj =
(HelloServer)Activator.GetObject(typeof(RemotingTest.HelloServer),
"http://localhost:8085/Hello";);
  if (obj == null)
  {
 System.Console.WriteLine("Could not locate server");
  }
  else
  {
 string name = "blah";
 if ( args.Length > 0 )
 {
name = args[0];
 }
 Console.WriteLine(obj.Hello(name));
  }
}
  }
}


Server:

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;

namespace RemotingTest
{
  public class Server
  {

public static void Main(string [] args) {

  HttpChannel chan = new HttpChannel(8085);
  ChannelServices.RegisterChannel(chan);
 
RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType("Remotin
gTest.HelloServer,Object"), "Hello", WellKnownObjectMode.SingleCall);
  System.Console.WriteLine("Hit  to exit...");
  System.Console.ReadLine();
}
  }
}

Test Class:

using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Http;
using System.Reflection;

namespace RemotingTest
{
  public class HelloServer : MarshalByRefObject
  {

public HelloServer()
{
  Console.WriteLine(this.ToString() + " activated");
}

public String Hello(String name)
{
  Console.WriteLine("HelloServer.Hello : {0}", name);
  return String.Format("Hi there {0}", name);
}
  }
}


Firstly, unlike using the MS.NET SDK it will not work unless one loads
the configuration like:


   
  
 
 
 

 
  
   


I was wondering why the difference in behaviour - does windows have the
http channels already registered in some default configuration which
mono doesn't have or is there a difference in behaviour of
ChannelServices.RegisterChannel() in the mono library - I notice that
the registered channels are stored in a static array in the
ChannelServices class so it strikes me that another program is not going
to have access to this - or am I missing something here?  It would be
nice to have an example that worked the same with both mono and the MS
SDK.

Secondly I am getting weird intermittent behaviour from both server and
client code - every once in a while I am getting:

** (process:5787): ERROR (recursed) **: file class.c: line 1272
(mono_class_init): assertion failed: (class) aborting...

from the client code, which appears to hang afterwards - the server
however behaves as expected.  I am unable to reproduce this at will
however.

I also am occasionally getting:

 
** (server.exe:12805): WARNING **: : unref on 38 called when ref was
already 0
 
>From the server after the remote method has been called - again this is
intermittent and not reproducible at will.

It also appears that neither the client or the server are cleaning up
properly as there are parentless processes left behind (which I take to
be threads - but I never found out how to distinguish processes and
threads with 'ps' on Linux).  This is with Beta 1 on Mandrake 9.2 x86.

Finally does anyone know of any documentation regarding the SOAP
messages involved in http remot

RE: [Mono-list] Mono Beta1 and Error with Monodoc

2004-05-12 Thread Robert Remen
Hi,

The package thaht you need is "libgtkhtml3.0_4-3.0.10-0.ximian.6.1".
Look for these files:

/usr/lib/libgtkhtml-3.0.so.4
/usr/lib/libgtkhtml-3.0.so.4.0.0

Robert

-Original Message-
From: Tobias Bradtke [mailto:[EMAIL PROTECTED] 
Sent: Dienstag, 11. Mai 2004 03:07
To: [EMAIL PROTECTED]
Subject: [Mono-list] Mono Beta1 and Error with Monodoc

hi everyone,

i know installation-errors are boring, but i don't get it..

i'm running fedora-core2-test3 and installed mono from here:
http://www.go-mono.com/archive/beta1/fedora-1-i386/

'monodoc --make-index' does work, but just 'monodoc' througs an error:

--snip--

Unhandled Exception: System.DllNotFoundException: gtkhtml-3.0 in
<0x00053> (wrapper managed-to-native) Gtk.HTML:gtk_html_new () in
<0x00021> Gtk.HTML:.ctor () in [0x001aa] (at
/home/duncan/conf/mono-conf/monodoc/BUILD/monodoc-0.15/browser/browser.c
s:209) Monodoc.Browser:.ctor () in [0x00120] (at
/home/duncan/conf/mono-conf/monodoc/BUILD/monodoc-0.15/browser/browser.c
s:81) Monodoc.Driver:Main (string[])

--snap--

'rpm -q gtkhtml3' says: 'gtkhtml3-3.1.12-1' is installed.

if i search for 'gtkhtml*dll' i get severel locations with
"gtkhtml-sharp.dll", but none with "gtkhtml.dll" or so..

what can i do??


thanks,
webwurst

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] not installing mono.pc?

2004-05-06 Thread Robert Remen
Hi,

You need the mono-runtime-devel package.

Robert 

-Original Message-
From: Tyrel Haveman [mailto:[EMAIL PROTECTED] 
Sent: Donnerstag, 06. Mai 2004 06:45
To: [EMAIL PROTECTED]
Subject: [Mono-list] not installing mono.pc?

I installed mono beta 1 earlier today, and attempted to install
MonoDevelop 0.3 as well. However, when I try to ./configure MonoDevelop,
I get the message:
Package mono was not found in the pkg-config search path.
Perhaps you should add the directory containing `mono.pc'
to the PKG_CONFIG_PATH environment variable No package 'mono' found

I ran a search on all of my hard disks and there is no mono.pc file
anywhere. So how am I supposed to satisfy this library dependancy
btw, I installed mono using the yum repository for Fedora Core 1, if
this makes any difference (I should get the same stuff!)

Anyone have any ideas?

-Tyrel Haveman


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


RE: [Mono-list] How do I get the RPMs I need

2004-04-23 Thread Robert Remen
Hi!

You can find all packages that you need to install latest mono RPM for
RH 9 here:

http://www.go-mono.com/archive/0.31/redhat-9-i386/

Robert

-Original Message-
From: Peter Foley [mailto:[EMAIL PROTECTED] 
Sent: Freitag, 23. April 2004 02:30
To: [EMAIL PROTECTED]
Subject: [Mono-list] How do I get the RPMs I need



I have downloaded the Mono RPMs to a RedHat 9 install. The PC is NOT
connected
to the internet (for security reasons). How do I get all the
dependencies I need
(and what are they)?

Is it possible for the MONO project to a) keep a mirror of all the RPMs
they
need for Mono b) supply a command file that installs them in the right
order?

PS This is my first taste of Linux




---
ABS Web Site:  www.abs.gov.au

___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] c# written daemon, System.ServiceProcess, posix signals handling...

2004-04-18 Thread Robert Remen
Hi!

I need to write an application in c#, wich should run in background and
be able to shut down gracefully when required.
The best solution would be to use the System.ServiceProcess namespace,
but this namespace is not implemented in mono. I know that there were
some discussion about this topic in summer 2003, but since i found
nothing. Is there something new in this direction?
The other way (not so nice, but would also do the job) would be the
catching of posix signals (SIGINT, SIGTERM...) but i have no idea how to
do thin in an mono application.
The last solution is to use some selfmade communication mechnism, to
comunicate with the process and initiate the shutdow - maybe using
remoting or some simpler mechanism.
Can someone give me some infos or ideas for the solution?

Thanx

Robert
___
Mono-list maillist  -  [EMAIL PROTECTED]
http://lists.ximian.com/mailman/listinfo/mono-list