Re: [Mono-list] Service or daemon with Mono?

2009-07-14 Thread Philip Wobst
Hi Jonas,

I found some documentation on remote objects that includes the setup of the 
server component as a service for windows or linux (including the steps to set 
it up). This might help you with your question:

http://www.peredur.uklinux.net/Remoting.pdf (pages 16 to 19)


-Ursprüngliche Nachricht-
Von: jos_ [mailto:j...@sonhult.se] 
Gesendet: Dienstag, 14. Juli 2009 14:45
An: mono-list@lists.ximian.com
Betreff: [Mono-list] Service or daemon with Mono?


Hello,

What is the recommended way to write a service-like software in Mono?

My first guess would be to use the normal class ServiceBase existing in Mono 
(and .NET of course). But there seems to be little information on how this 
works with Mono, and from what I've read it is not considered stable (?).

1. Is it better to just create a normal app, turn on automatic login and run it 
at login?
2. Is it possible to create a daemon using Mono?
3. Is there any documentation on how to "install" the "service" if developed in 
Mono using ServiceBase (or any other method)?

In short: I'm looking for a way to build the Linux equivalent for a service 
using Mono, and install it on a Linux-dist =)

Thanks in advance!
/ Jonas
--
View this message in context: 
http://www.nabble.com/Service-or-daemon-with-Mono--tp24478743p24478743.html
Sent from the Mono - General mailing list archive at Nabble.com.


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


Re: [Mono-list] Pre-compiled Assemblies

2009-07-14 Thread Gonzalo Paniagua Javier
On Mon, 2009-07-13 at 22:06 -0400, Abe Gillespie wrote:
> I thought there existed a package of pre-compiled assemblies available
> for download.  My problem is while compiling Mono my machine runs out
> of memory (162mb) during compilation of the core assemblies.
> Specifically it dies while processing (generating?)
> mono-2.4.2.1/mcs/docs/netdocs.tree.  Now if I use the
> --disable-mcs-build option then I can successfully build but I don't
> have any assemblies to install on my system.
> 
> Would someone point me to the package (if I'm not making that up) or
> offer some assistance?

When running configure or autogen.sh in the 'mono' directory, add this:
--with-mcs-docs=no

and the documentation won't be built.

-Gonzalo


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


Re: [Mono-list] Problem with XML-Serialization

2009-07-14 Thread Atsushi Eno
Let's please file a bug on our bugzilla. I'll have a look.
http://mono-project.com/Bugs

Atsushi Eno

Blackskyliner wrote:
> I serialize this class via the XML Serializer:
> 
> 
> class XMLStringSerializer
> {
> public static string Serialize(T entity)
> {
> return Serialize(entity, true);
> }
> 
> public static string Serialize(T entity, bool noNewLine)
> {
> StringBuilder outputXml = new StringBuilder();
> 
> if (typeof(T).IsSerializable)
> {
> XmlSerializer ser = new XmlSerializer(typeof(T));
> using (TextWriter stream = new StringWriter(outputXml))
> {
> ser.Serialize(stream, entity);
> }
> if (noNewLine)
> return outputXml.ToString().Replace(Environment.NewLine,
> "");
> else
> return outputXml.ToString();
> }
> 
> return null;
> }
> 
> public static T Deserialize(string xml)
> {
> T entity;
> 
> if (typeof(T).IsSerializable)
> {
> XmlSerializer ser = new XmlSerializer(typeof(T));
> using (TextReader stream = new StringReader(xml))
> {
> entity = (T)ser.Deserialize(stream);
> }
> 
> return entity;
> }
> 
> return default(T);
> }
> }
> 
> 
> 
> 
> 
> Atsushi Eno-3 wrote:
>> Hi,
>>
>> Your subject implies it is about xml serialization, but it is
>> marked as [Serializable]. Which "serialization" do you mean?
>> XML serialization, or remoting SOAP serialization?
>>
>> Atsushi Eno
>>
>>
>> Blackskyliner wrote:
>>> Hi I just jumped in into mono I hope I'm in the right forum/mailinglist,
>>> because i wrote an little server application that I wanted to run on my
>>> linux machine. Its originally written in .NET 2.0
>>>
>>> To exchange Messages between Server and Client I use an XML-serialized
>>> class
>>> In .NET I dont get any problems but with mono I get the following
>>> exception:
>>>
>>>  There was an error generating the XML document. > The type of the
>>> argument
>>> object 'ChatClient.serverMessages' is not primitive.
>>>
>>> I implemented the serverMessage in the following way:
>>>
>>> using System;
>>> using System.Text;
>>>
>>> namespace ChatClient
>>> {
>>> [Serializable]
>>> public class Message
>>> {
>>> public Message_StatusCodes statusCode;
>>> public messageType messageType;
>>> public object message;
>>> public DateTime time;
>>> public string user;
>>>
>>> public Message()
>>> {
>>> init();
>>> }
>>>
>>> public Message(string Username)
>>> {
>>> init();
>>> this.user = Username;
>>> }
>>>
>>> private void init(){
>>> this.statusCode = Message_StatusCodes.NULL;
>>> this.message = null;
>>> this.time = DateTime.Now;
>>> this.user = null;
>>> this.messageType = messageType.NULL;
>>> }
>>>
>>> public void Clear()
>>> {
>>> this.statusCode = Message_StatusCodes.NULL;
>>> this.messageType = messageType.NULL;
>>> this.message = null;
>>> this.time = DateTime.Now;
>>> this.user = null;
>>> }
>>>
>>> public void Clear(string Username)
>>> {
>>> this.Clear();
>>> this.user = Username;
>>> }
>>>
>>> public Message(Message_StatusCodes c)
>>> {
>>> init();
>>> this.statusCode = c;
>>> }
>>> }
>>>
>>> public enum Message_StatusCodes
>>> {
>>> NULL,
>>>
>>> Login,
>>>
>>> UserKicked,
>>> UserJoined,
>>> UserConnected,
>>> UserDisconnected,
>>>
>>> UserListChanged
>>> }
>>>
>>> public enum messageType{
>>> NULL,
>>> UserMessage,
>>> ServerMessage,
>>> ClientMessage
>>> }
>>>
>>> public enum serverMessages
>>> {
>>> LOGIN_ERROR_UserAlreadyExist,
>>> LOGIN_ERROR_UsernameReserved,
>>> LOGIN_OK
>>> }
>>>
>>> public enum clientMessages
>>> {
>>> Disconnect
>>> }
>>> }
>>>
>>>
>>> Why does this not deserialize in Mono but in C#?? Is there any workaround
>>> or
>>> smth. else?
>>>
>>> I'm thankful about every answer...
>>> Blackskyliner
>> ___
>> Mono-list maillist  -  Mono-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>>
> 

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


Re: [Mono-list] Fwd: Fwd: Game development with mono

2009-07-14 Thread Justin Dearing
Alan/Chris,


Thanks for clarifying.



On Tue, Jul 14, 2009 at 6:17 PM, Alan McGovern wrote:

> Hey,
>
> Comments below...
>
> On Tue, Jul 14, 2009 at 11:06 PM, Justin Dearing wrote:
>
>> Forgot once again mono doest have a default reply to the list for some
>> reason.
>>
>> -- Forwarded message --
>> From: Justin Dearing 
>>  Date: Tue, Jul 14, 2009 at 6:05 PM
>> Subject: Re: [Mono-list] Fwd: Game development with mono
>> To: Chris Howie 
>>
>>
>> Chris,
>> If there is no difference, why do many OSS projects offer different
>> binaries?
>>
>
> 99.9% of the time there is no need to offer different 'binaries' for CIL
> assemblies because the 'binaries' for each platform will be bit identical.
>
>
>> I understand the format of the bytecode is different, but might there be
>> differences in function signatures in the System.foo assemblies if mono
>> functions had different signatures from the .NET equivilant?
>>
>
> I'm not sure what you mean here. Mono should be API compatible with MS
> .NET.
>
>  Also, doesn't the mono compiler and runtime  have a different GAC.
>> Wouldn't compiling against the mono compiler ensure that all the methods in
>> the standard assemblies exist in the mono version?
>>
>
> Sure, compiling under mono would ensure that you are not using a method
> that does not exist. There are other tools which can help with that, such as
> Moma (http://mono-project.com/MoMA). Sure, you can compile under mono, but
> it's not a necessity. Rregularly running your regression tests under both
> frameworks would be a great way to ensure everything operates as expected.
>
> Alan.
>
>
>>
>>
>> Regards,
>>
>> Justin Dearing
>>
>> On Tue, Jul 14, 2009 at 5:52 PM, Chris Howie  wrote:
>>
>>> On Tue, Jul 14, 2009 at 5:08 PM, Justin Dearing
>>> wrote:
>>> > Coding with
>>> > Visual Studio and periodontally compiling to mono on windows will
>>> ensure
>>> > compatability.
>>>
>>> I should point out that you don't have to "compile to mono" to test,
>>> you can just run the Windows-.NET-compiled binaries directly on Mono.
>>> Compiling using Mono's C# compiler /should/ only serves to test Mono's
>>> C# compiler; the binary format of the CIL images is identical.
>>>
>>> (I have a feeling that Justin knows this, just clarifying for those who
>>> don't.)
>>>
>>> --
>>> Chris Howie
>>> http://www.chrishowie.com
>>> http://en.wikipedia.org/wiki/User:Crazycomputers
>>>
>>
>>
>>
>> ___
>> Mono-list maillist  -  Mono-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-list
>>
>>
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Fwd: Game development with mono

2009-07-14 Thread Mark Collins
Thanks, this is all great information.

Mark

On Tue, Jul 14, 2009 at 5:39 PM, Chris Howie  wrote:

> Alan answered most of the points, but I have one additional comment:
>
> On Tue, Jul 14, 2009 at 6:05 PM, Justin Dearing
> wrote:
> > If there is no difference, why do many OSS projects offer different
> > binaries?
>
> It's possible that they build using some #if blocks to alter behavior
> depending on the platform, but note that this is not necessary -- the
> execution platform can easily be detected at runtime.
>
> A more legitimate reason is that there may be some C glue library
> required on both platforms, and the different binary archives need to
> package the platform-specific glue.  Again, the managed (CIL) code can
> easily be identical in this case as well.
>
> --
> Chris Howie
> http://www.chrishowie.com
> http://en.wikipedia.org/wiki/User:Crazycomputers
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>



-- 
- Alder Massimo Vitelion Essex, Status 2 Invictus, Status 2 Daeva
OOC: http://wiki.white-wolf.com/camwiki/index.php?title=Massimo_della_Aniela

Mark Collins, US2008113152
Austin, TX
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Fwd: Game development with mono

2009-07-14 Thread Chris Howie
Alan answered most of the points, but I have one additional comment:

On Tue, Jul 14, 2009 at 6:05 PM, Justin Dearing wrote:
> If there is no difference, why do many OSS projects offer different
> binaries?

It's possible that they build using some #if blocks to alter behavior
depending on the platform, but note that this is not necessary -- the
execution platform can easily be detected at runtime.

A more legitimate reason is that there may be some C glue library
required on both platforms, and the different binary archives need to
package the platform-specific glue.  Again, the managed (CIL) code can
easily be identical in this case as well.

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Fwd: Fwd: Game development with mono

2009-07-14 Thread Alan McGovern
Hey,

Comments below...

On Tue, Jul 14, 2009 at 11:06 PM, Justin Dearing wrote:

> Forgot once again mono doest have a default reply to the list for some
> reason.
>
> -- Forwarded message --
> From: Justin Dearing 
> Date: Tue, Jul 14, 2009 at 6:05 PM
> Subject: Re: [Mono-list] Fwd: Game development with mono
> To: Chris Howie 
>
>
> Chris,
> If there is no difference, why do many OSS projects offer different
> binaries?
>

99.9% of the time there is no need to offer different 'binaries' for CIL
assemblies because the 'binaries' for each platform will be bit identical.


> I understand the format of the bytecode is different, but might there be
> differences in function signatures in the System.foo assemblies if mono
> functions had different signatures from the .NET equivilant?
>

I'm not sure what you mean here. Mono should be API compatible with MS .NET.

Also, doesn't the mono compiler and runtime  have a different GAC. Wouldn't
> compiling against the mono compiler ensure that all the methods in the
> standard assemblies exist in the mono version?
>

Sure, compiling under mono would ensure that you are not using a method that
does not exist. There are other tools which can help with that, such as Moma
(http://mono-project.com/MoMA). Sure, you can compile under mono, but it's
not a necessity. Rregularly running your regression tests under both
frameworks would be a great way to ensure everything operates as expected.

Alan.


>
>
> Regards,
>
> Justin Dearing
>
> On Tue, Jul 14, 2009 at 5:52 PM, Chris Howie  wrote:
>
>> On Tue, Jul 14, 2009 at 5:08 PM, Justin Dearing
>> wrote:
>> > Coding with
>> > Visual Studio and periodontally compiling to mono on windows will ensure
>> > compatability.
>>
>> I should point out that you don't have to "compile to mono" to test,
>> you can just run the Windows-.NET-compiled binaries directly on Mono.
>> Compiling using Mono's C# compiler /should/ only serves to test Mono's
>> C# compiler; the binary format of the CIL images is identical.
>>
>> (I have a feeling that Justin knows this, just clarifying for those who
>> don't.)
>>
>> --
>> Chris Howie
>> http://www.chrishowie.com
>> http://en.wikipedia.org/wiki/User:Crazycomputers
>>
>
>
>
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Fwd: Game development with mono

2009-07-14 Thread Chris Howie
On Tue, Jul 14, 2009 at 5:08 PM, Justin Dearing wrote:
> Coding with
> Visual Studio and periodontally compiling to mono on windows will ensure
> compatability.

I should point out that you don't have to "compile to mono" to test,
you can just run the Windows-.NET-compiled binaries directly on Mono.
Compiling using Mono's C# compiler /should/ only serves to test Mono's
C# compiler; the binary format of the CIL images is identical.

(I have a feeling that Justin knows this, just clarifying for those who don't.)

-- 
Chris Howie
http://www.chrishowie.com
http://en.wikipedia.org/wiki/User:Crazycomputers
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Fwd: Fwd: Game development with mono

2009-07-14 Thread Justin Dearing
Forgot once again mono doest have a default reply to the list for some
reason.

-- Forwarded message --
From: Justin Dearing 
Date: Tue, Jul 14, 2009 at 6:05 PM
Subject: Re: [Mono-list] Fwd: Game development with mono
To: Chris Howie 


Chris,
If there is no difference, why do many OSS projects offer different
binaries?

I understand the format of the bytecode is different, but might there be
differences in function signatures in the System.foo assemblies if mono
functions had different signatures from the .NET equivilant?

Also, doesn't the mono compiler and runtime  have a different GAC. Wouldn't
compiling against the mono compiler ensure that all the methods in the
standard assemblies exist in the mono version?

Regards,

Justin Dearing

On Tue, Jul 14, 2009 at 5:52 PM, Chris Howie  wrote:

> On Tue, Jul 14, 2009 at 5:08 PM, Justin Dearing
> wrote:
> > Coding with
> > Visual Studio and periodontally compiling to mono on windows will ensure
> > compatability.
>
> I should point out that you don't have to "compile to mono" to test,
> you can just run the Windows-.NET-compiled binaries directly on Mono.
> Compiling using Mono's C# compiler /should/ only serves to test Mono's
> C# compiler; the binary format of the CIL images is identical.
>
> (I have a feeling that Justin knows this, just clarifying for those who
> don't.)
>
> --
> Chris Howie
> http://www.chrishowie.com
> http://en.wikipedia.org/wiki/User:Crazycomputers
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Fwd: Game development with mono

2009-07-14 Thread Justin Dearing
-- Forwarded message --
From: Justin Dearing 
Date: Tue, Jul 14, 2009 at 5:08 PM
Subject: Re: [Mono-list] Game development with mono
To: Mark Collins 


Mark,
Mono definitely only has a subset of the .NET Framework implemented. I don't
know how much of that has to do with gaming, or what gaming features you
need. However, the easiest way to code for both platforms, is to simply
constantly test on both platforms.

SharpDevelop 2 has support for .NET and mono. It is a bit lacking as an IDE,
but it will run visual studio 2005 solutions and projects. Coding with
Visual Studio and periodontally compiling to mono on windows will ensure
compatability. I believe there are separately maintained mono plugins for
sharpdevelop 3.x if you want to compile visual studio 2008 projects to Mono.

Another thing in regards to mono on windows as opposed to mono on linux,
there are some features of mono that work in windows and not linux.
Cominterop does not work on linux. pinvoke does work, but you lack the
windows api on linux. I don't know if unity, wine or any of that changes
those rules, but even if you compile mono binaries on windows, test them on
linux.

Regards,

Justin Dearing

On Tue, Jul 14, 2009 at 4:40 PM, Mark Collins  wrote:

> I got half way through a programming degree before ANSI/ISO C++, and ten
> years later have started to pick up some C#.
>
> I am looking to do game development using Mono and Unity, but wonder what
> resources are out there.
>
> Can I just stick to regular C#/.NET in Mono and get the cross platform
> ability I want, later hoping Unity will run on Linux as well, or is there a
> special subset of C#/.NET I have to program to in order to use Mono?
>
> What would be some good books/references that I can use to teach myself?
> Sample code, tutorials, etc.
>
> Mark Collins
>
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Service or daemon with Mono?

2009-07-14 Thread Danny
Thanks alot.  Indeed it does look pretty vanilla in term of the remoting 
usage, but one difference IS the SingleCall.  I'll take a closer look 
when I can get back to that ticket.

Thanks again,
Danny

Amc Gmail wrote:
> Hmmm... hard to say, i did remoting part 4+ years ago :) in .net 1.1 era :)
> It sees to be I am not doing anything special, but keep in mind i am using 
> mode="SingleCall"
> 
> Here is more details:
> 
> 
> 
> 
>  mode="SingleCall" 
> />
> 
> 
> 
> 
> 
> 
> 
> 
> And all remoting types/methods are in one class:
> 
> namespace Rmt {
> public class RmtBridge : MarshalByRefObject {...}
> }
> 
> Service has multiple threads and some of them are control threads which i am 
> using to kill real worker threads if they are hang. Control thread code look 
> like:
> 
> public override void ControlThreadLoop() {
> 
> // Configure remoting
> bool isInitOk = InitRemoting();
> if (IsStop()) return;   // exit signaled
> if (!isInitOk) {
> // Fail to init remoting - log exception and continue 
> . error EventLog here...
> }
> 
> while (!IsStop()) {
>  create worker thread and monitor it health 
> }
> }
> 
> // Try to configure remoting, return true on success
> private bool InitRemoting() {
> for (int j = 0; !IsStop() && j < INIT_ATTEMPT_COUNT; j++) {
> try {
> RemotingConfiguration.Configure(
> System.IO.Path.Combine(
> AppDomain.CurrentDomain.BaseDirectory, 
> AppDomain.CurrentDomain.FriendlyName + ".config"
> ));
> return true;// success
> }
> catch(Exception e) {
> . warning EventLog here...
> }
> 
> // sleep before next attempt
> IdleSleep(IDLE_SLEEP_TIME);
> }
> 
> return false;   // not initialized
> }
> }
> 
> sorry for that long e-mail, hope it helps (not sure about that, but trying my 
> best :)
> -- amc
> 
> 
> - Original Message -
> From: "Danny" 
> To: "Amc Gmail" 
> Cc: "jos_" , mono-list@lists.ximian.com
> Sent: Tuesday, July 14, 2009 3:47:17 PM GMT -05:00 US/Canada Eastern
> Subject: Re: [Mono-list] Service or daemon with Mono?
> 
> I'd like to second that.  I use the same techniques with good results. 
> However, *occasionally* I have problems with my remoting listener 
> holding open the TCP socket after shutdown (in which I unregister the 
> marshalled object(s)).
> 
> If you don't mind me asking, do you do anything specific or special to 
> clean up your remoting channel?
> 
> Amc Gmail wrote:
>> We don't have any problems with .NET service running under Mono. 
>> It's based on ServiceBase, uses EventLog and .NET Remoting without any 
>> problems.
>> All you need to do is to create init.d script to start/stop mono-service 
>> during startup/shutdown
>> -- amc
>>
>> - Original Message -
>> From: "jos_" 
>> To: mono-list@lists.ximian.com
>> Sent: Tuesday, July 14, 2009 8:45:07 AM GMT -05:00 US/Canada Eastern
>> Subject: [Mono-list]  Service or daemon with Mono?
>>
>>
>> Hello,
>>
>> What is the recommended way to write a service-like software in Mono?
>>
>> My first guess would be to use the normal class ServiceBase existing in Mono
>> (and .NET of course). But there seems to be little information on how this
>> works with Mono, and from what I've read it is not considered stable (?).
>>
>> 1. Is it better to just create a normal app, turn on automatic login and run
>> it at login?
>> 2. Is it possible to create a daemon using Mono?
>> 3. Is there any documentation on how to "install" the "service" if developed
>> in Mono using ServiceBase (or any other method)?
>>
>> In short: I'm looking for a way to build the Linux equivalent for a service
>> using Mono, and install it on a Linux-dist =)
>>
>> Thanks in advance!
>> / Jonas
> 
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


[Mono-list] Game development with mono

2009-07-14 Thread Mark Collins
I got half way through a programming degree before ANSI/ISO C++, and ten
years later have started to pick up some C#.

I am looking to do game development using Mono and Unity, but wonder what
resources are out there.

Can I just stick to regular C#/.NET in Mono and get the cross platform
ability I want, later hoping Unity will run on Linux as well, or is there a
special subset of C#/.NET I have to program to in order to use Mono?

What would be some good books/references that I can use to teach myself?
Sample code, tutorials, etc.

Mark Collins
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Service or daemon with Mono?

2009-07-14 Thread Amc Gmail
Hmmm... hard to say, i did remoting part 4+ years ago :) in .net 1.1 era :)
It sees to be I am not doing anything special, but keep in mind i am using 
mode="SingleCall"

Here is more details:













And all remoting types/methods are in one class:

namespace Rmt {
public class RmtBridge : MarshalByRefObject {...}
}

Service has multiple threads and some of them are control threads which i am 
using to kill real worker threads if they are hang. Control thread code look 
like:

public override void ControlThreadLoop() {

// Configure remoting
bool isInitOk = InitRemoting();
if (IsStop()) return;   // exit signaled
if (!isInitOk) {
// Fail to init remoting - log exception and continue 
. error EventLog here...
}

while (!IsStop()) {
 create worker thread and monitor it health 
}
}

// Try to configure remoting, return true on success
private bool InitRemoting() {
for (int j = 0; !IsStop() && j < INIT_ATTEMPT_COUNT; j++) {
try {
RemotingConfiguration.Configure(
System.IO.Path.Combine(
AppDomain.CurrentDomain.BaseDirectory, 
AppDomain.CurrentDomain.FriendlyName + ".config"
));
return true;// success
}
catch(Exception e) {
. warning EventLog here...
}

// sleep before next attempt
IdleSleep(IDLE_SLEEP_TIME);
}

return false;   // not initialized
}
}

sorry for that long e-mail, hope it helps (not sure about that, but trying my 
best :)
-- amc


- Original Message -
From: "Danny" 
To: "Amc Gmail" 
Cc: "jos_" , mono-list@lists.ximian.com
Sent: Tuesday, July 14, 2009 3:47:17 PM GMT -05:00 US/Canada Eastern
Subject: Re: [Mono-list] Service or daemon with Mono?

I'd like to second that.  I use the same techniques with good results. 
However, *occasionally* I have problems with my remoting listener 
holding open the TCP socket after shutdown (in which I unregister the 
marshalled object(s)).

If you don't mind me asking, do you do anything specific or special to 
clean up your remoting channel?

Amc Gmail wrote:
> We don't have any problems with .NET service running under Mono. 
> It's based on ServiceBase, uses EventLog and .NET Remoting without any 
> problems.
> All you need to do is to create init.d script to start/stop mono-service 
> during startup/shutdown
> -- amc
> 
> - Original Message -
> From: "jos_" 
> To: mono-list@lists.ximian.com
> Sent: Tuesday, July 14, 2009 8:45:07 AM GMT -05:00 US/Canada Eastern
> Subject: [Mono-list]  Service or daemon with Mono?
> 
> 
> Hello,
> 
> What is the recommended way to write a service-like software in Mono?
> 
> My first guess would be to use the normal class ServiceBase existing in Mono
> (and .NET of course). But there seems to be little information on how this
> works with Mono, and from what I've read it is not considered stable (?).
> 
> 1. Is it better to just create a normal app, turn on automatic login and run
> it at login?
> 2. Is it possible to create a daemon using Mono?
> 3. Is there any documentation on how to "install" the "service" if developed
> in Mono using ServiceBase (or any other method)?
> 
> In short: I'm looking for a way to build the Linux equivalent for a service
> using Mono, and install it on a Linux-dist =)
> 
> Thanks in advance!
> / Jonas
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Service or daemon with Mono?

2009-07-14 Thread Danny
I'd like to second that.  I use the same techniques with good results. 
However, *occasionally* I have problems with my remoting listener 
holding open the TCP socket after shutdown (in which I unregister the 
marshalled object(s)).

If you don't mind me asking, do you do anything specific or special to 
clean up your remoting channel?

Amc Gmail wrote:
> We don't have any problems with .NET service running under Mono. 
> It's based on ServiceBase, uses EventLog and .NET Remoting without any 
> problems.
> All you need to do is to create init.d script to start/stop mono-service 
> during startup/shutdown
> -- amc
> 
> - Original Message -
> From: "jos_" 
> To: mono-list@lists.ximian.com
> Sent: Tuesday, July 14, 2009 8:45:07 AM GMT -05:00 US/Canada Eastern
> Subject: [Mono-list]  Service or daemon with Mono?
> 
> 
> Hello,
> 
> What is the recommended way to write a service-like software in Mono?
> 
> My first guess would be to use the normal class ServiceBase existing in Mono
> (and .NET of course). But there seems to be little information on how this
> works with Mono, and from what I've read it is not considered stable (?).
> 
> 1. Is it better to just create a normal app, turn on automatic login and run
> it at login?
> 2. Is it possible to create a daemon using Mono?
> 3. Is there any documentation on how to "install" the "service" if developed
> in Mono using ServiceBase (or any other method)?
> 
> In short: I'm looking for a way to build the Linux equivalent for a service
> using Mono, and install it on a Linux-dist =)
> 
> Thanks in advance!
> / Jonas
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] Service or daemon with Mono?

2009-07-14 Thread Amc Gmail
We don't have any problems with .NET service running under Mono. 
It's based on ServiceBase, uses EventLog and .NET Remoting without any problems.
All you need to do is to create init.d script to start/stop mono-service during 
startup/shutdown
-- amc

- Original Message -
From: "jos_" 
To: mono-list@lists.ximian.com
Sent: Tuesday, July 14, 2009 8:45:07 AM GMT -05:00 US/Canada Eastern
Subject: [Mono-list]  Service or daemon with Mono?


Hello,

What is the recommended way to write a service-like software in Mono?

My first guess would be to use the normal class ServiceBase existing in Mono
(and .NET of course). But there seems to be little information on how this
works with Mono, and from what I've read it is not considered stable (?).

1. Is it better to just create a normal app, turn on automatic login and run
it at login?
2. Is it possible to create a daemon using Mono?
3. Is there any documentation on how to "install" the "service" if developed
in Mono using ServiceBase (or any other method)?

In short: I'm looking for a way to build the Linux equivalent for a service
using Mono, and install it on a Linux-dist =)

Thanks in advance!
/ Jonas
-- 
View this message in context: 
http://www.nabble.com/Service-or-daemon-with-Mono--tp24478743p24478743.html
Sent from the Mono - General mailing list archive at Nabble.com.

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


Re: [Mono-list] Service or daemon with Mono?

2009-07-14 Thread Robert Jordan
jos_ wrote:
> Hello,
> 
> What is the recommended way to write a service-like software in Mono?
> 
> My first guess would be to use the normal class ServiceBase existing in Mono
> (and .NET of course). But there seems to be little information on how this
> works with Mono, and from what I've read it is not considered stable (?).

It is stable, but it only provides basic services support. It does
not support installation, for example.

> 1. Is it better to just create a normal app, turn on automatic login and run
> it at login?

Nope.

> 2. Is it possible to create a daemon using Mono?

Yes. It could be as simple as running a console application
with "nohup mono app.exe &".

> 3. Is there any documentation on how to "install" the "service" if developed
> in Mono using ServiceBase (or any other method)?

Mono does not provide this documentation because almost every distro
has its own more or less similar concept of running "services".

Robert

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


Re: [Mono-list] how to execute exe file which creates logs in event viewer.

2009-07-14 Thread Robert Jordan
Bharti Mishra wrote:
> hi,
> I am using mono2.4.2 on Open Suse11.1 platform.
>  I have existing vb.net code, in which I execute one .exe file before
> project execution, that exe file creats log in EventViewer (windows).
>now I have to run that .exe in linux platform, so can you tell me ,I can
> run that kind of exe in mono.

It depends on what kind of .exe that said file is. It should work if
it's a managed application. Search for MONO_EVENTLOG_TYPE in mono's man
page to find out how to configure the event log output.

Robert

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


[Mono-list] .net compact framework

2009-07-14 Thread prg_pma

As can be used to program in monodevelop for . NET Compact Framework
-- 
View this message in context: 
http://www.nabble.com/.net-compact-framework-tp24479968p24479968.html
Sent from the Mono - General mailing list archive at Nabble.com.

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


[Mono-list] Service or daemon with Mono?

2009-07-14 Thread jos_

Hello,

What is the recommended way to write a service-like software in Mono?

My first guess would be to use the normal class ServiceBase existing in Mono
(and .NET of course). But there seems to be little information on how this
works with Mono, and from what I've read it is not considered stable (?).

1. Is it better to just create a normal app, turn on automatic login and run
it at login?
2. Is it possible to create a daemon using Mono?
3. Is there any documentation on how to "install" the "service" if developed
in Mono using ServiceBase (or any other method)?

In short: I'm looking for a way to build the Linux equivalent for a service
using Mono, and install it on a Linux-dist =)

Thanks in advance!
/ Jonas
-- 
View this message in context: 
http://www.nabble.com/Service-or-daemon-with-Mono--tp24478743p24478743.html
Sent from the Mono - General mailing list archive at Nabble.com.

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


[Mono-list] Problem compiling C# project

2009-07-14 Thread clarkey

Trying to compile this prograp called Open dental which has a depenency
called CDT.dll which it cant seem to load, any suggestions?

Building: OpenDentBusiness (LinuxRelease)
Performing main compilation...
/usr/local/bin/gmcs
"/out:/home/matt/development/Opendental/OpenDentBusiness/bin/LinuxRelease/OpenDentBusiness.dll"
"/r:/home/matt/development/Opendental/Required dlls/CDT.dll"
"/r:/home/matt/development/Opendental/Required dlls/Interop.Word.dll"
"/r:/home/matt/development/Opendental/Required dlls/MySql.Data.dll"
"/r:System.dll" "/r:System.Data.dll" "/r:System.Drawing.dll"
"/r:System.EnterpriseServices.dll" "/r:System.Web.Services.dll"
"/r:System.Windows.Forms.dll" "/r:System.Xml.dll"
"/r:/home/matt/development/Opendental/CodeBase/bin/LinuxRelease/CodeBase.dll"
/noconfig /nologo /warn:3 /debug:+ /debug:full /optimize+ /codepage:utf8
-unsafe /define:"TRACE;LINUX" /t:library
"/home/matt/development/Opendental/OpenDentBusiness/Misc/AnestheticQueries.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/aaCache.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AccountC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AccountingAutoPayC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnesthMedsInventoryC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AppointmentRuleC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ApptViewItemC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ApptViewC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AutoCodeCondC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AutoCodeC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AutoCodeItemC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/Cache.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ClaimFormItemC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnesthMedSupplierC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnestheticDataC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnestheticMedsGivenC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnesthMedsC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnesthMedInvAdjC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/AnesthVSDataC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/Anes_HL7DataC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ProcedureCodeC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ProgramPropertyC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ProgramC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/PharmacyC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/FeeSchedC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/RecallTriggerC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/RecallTypeC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/SheetFieldDefC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/SheetDefC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/SiteC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/DisplayFieldC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/ProviderC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/OperatoryC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/CovSpanC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/GroupPermissionC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/UserodC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/CovCatC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/DefC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/EnumRemotingRole.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/MountDefC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Cache/PrefC.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Misc/ConvertDatabases2.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Misc/ConvertDatabases1.cs"
"/home/matt/development/Opendental/OpenDentBusiness/ClientSL.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/aaDataInterface.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/AccountingAutoPays.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/Accounts.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/Adjustments.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/AnesthMeds.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/AnestheticRecords.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/AnesthMedsGivens.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/AnesthVSDatas.cs"
"/home/matt/development/Opendental/OpenDentBusiness/Data
Interface/AppointmentRules.cs"
"/home/matt/development/Opendental/OpenDentBusiness/

[Mono-list] how to execute exe file which creates logs in event viewer.

2009-07-14 Thread Bharti Mishra

hi,
I am using mono2.4.2 on Open Suse11.1 platform.
 I have existing vb.net code, in which I execute one .exe file before
project execution, that exe file creats log in EventViewer (windows).
   now I have to run that .exe in linux platform, so can you tell me ,I can
run that kind of exe in mono.
-- 
View this message in context: 
http://www.nabble.com/how-to-execute-exe-file-which-creates-logs-in-event-viewer.-tp24477967p24477967.html
Sent from the Mono - General mailing list archive at Nabble.com.

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


Re: [Mono-list] Problem with XML-Serialization

2009-07-14 Thread Blackskyliner

I serialize this class via the XML Serializer:


class XMLStringSerializer
{
public static string Serialize(T entity)
{
return Serialize(entity, true);
}

public static string Serialize(T entity, bool noNewLine)
{
StringBuilder outputXml = new StringBuilder();

if (typeof(T).IsSerializable)
{
XmlSerializer ser = new XmlSerializer(typeof(T));
using (TextWriter stream = new StringWriter(outputXml))
{
ser.Serialize(stream, entity);
}
if (noNewLine)
return outputXml.ToString().Replace(Environment.NewLine,
"");
else
return outputXml.ToString();
}

return null;
}

public static T Deserialize(string xml)
{
T entity;

if (typeof(T).IsSerializable)
{
XmlSerializer ser = new XmlSerializer(typeof(T));
using (TextReader stream = new StringReader(xml))
{
entity = (T)ser.Deserialize(stream);
}

return entity;
}

return default(T);
}
}





Atsushi Eno-3 wrote:
> 
> Hi,
> 
> Your subject implies it is about xml serialization, but it is
> marked as [Serializable]. Which "serialization" do you mean?
> XML serialization, or remoting SOAP serialization?
> 
> Atsushi Eno
> 
> 
> Blackskyliner wrote:
>> Hi I just jumped in into mono I hope I'm in the right forum/mailinglist,
>> because i wrote an little server application that I wanted to run on my
>> linux machine. Its originally written in .NET 2.0
>> 
>> To exchange Messages between Server and Client I use an XML-serialized
>> class
>> In .NET I dont get any problems but with mono I get the following
>> exception:
>> 
>>  There was an error generating the XML document. > The type of the
>> argument
>> object 'ChatClient.serverMessages' is not primitive.
>> 
>> I implemented the serverMessage in the following way:
>> 
>> using System;
>> using System.Text;
>> 
>> namespace ChatClient
>> {
>> [Serializable]
>> public class Message
>> {
>> public Message_StatusCodes statusCode;
>> public messageType messageType;
>> public object message;
>> public DateTime time;
>> public string user;
>> 
>> public Message()
>> {
>> init();
>> }
>> 
>> public Message(string Username)
>> {
>> init();
>> this.user = Username;
>> }
>> 
>> private void init(){
>> this.statusCode = Message_StatusCodes.NULL;
>> this.message = null;
>> this.time = DateTime.Now;
>> this.user = null;
>> this.messageType = messageType.NULL;
>> }
>> 
>> public void Clear()
>> {
>> this.statusCode = Message_StatusCodes.NULL;
>> this.messageType = messageType.NULL;
>> this.message = null;
>> this.time = DateTime.Now;
>> this.user = null;
>> }
>> 
>> public void Clear(string Username)
>> {
>> this.Clear();
>> this.user = Username;
>> }
>> 
>> public Message(Message_StatusCodes c)
>> {
>> init();
>> this.statusCode = c;
>> }
>> }
>> 
>> public enum Message_StatusCodes
>> {
>> NULL,
>> 
>> Login,
>> 
>> UserKicked,
>> UserJoined,
>> UserConnected,
>> UserDisconnected,
>> 
>> UserListChanged
>> }
>> 
>> public enum messageType{
>> NULL,
>> UserMessage,
>> ServerMessage,
>> ClientMessage
>> }
>> 
>> public enum serverMessages
>> {
>> LOGIN_ERROR_UserAlreadyExist,
>> LOGIN_ERROR_UsernameReserved,
>> LOGIN_OK
>> }
>> 
>> public enum clientMessages
>> {
>> Disconnect
>> }
>> }
>> 
>> 
>> Why does this not deserialize in Mono but in C#?? Is there any workaround
>> or
>> smth. else?
>> 
>> I'm thankful about every answer...
>> Blackskyliner
> 
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-XML-Serialization-tp24452869p24482404.html
Sent from the Mono - General mailing list archive at Nabble.com.

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


Re: [Mono-list] DllNotFoundException

2009-07-14 Thread Robert Jordan
Mikro Trekker wrote:
> Now I am getting "Unknown trace level" error:
> 
> H:\Work\SET MONO_LOG_LEVEL=debug
> H:\Work\SET MONO_LOG_MASK=dll
> 
> H:\Work\mono --debug TEST.exe
> Unknown trace flag: dll
> Unknown trace loglevel: debug

It works for me. You've probably permuted the env vars.

Robert

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


Re: [Mono-list] DllNotFoundException

2009-07-14 Thread Mikro Trekker
Now I am getting "Unknown trace level" error:

H:\Work\SET MONO_LOG_LEVEL=debug
H:\Work\SET MONO_LOG_MASK=dll

H:\Work\mono --debug TEST.exe
Unknown trace flag: dll
Unknown trace loglevel: debug
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] GTK-Sharp: Cannot implicitly convert type `Cairo.Context' to `Cairo.Context'

2009-07-14 Thread Alan McGovern
If it was all working before, I'm unsure why it would just stop working
after updating from SVN. The best I can offer is that you should check to
see if you changed anything on your system or installed new packages which
might result in this conflict.

Finally, you should follow the guide on setting up a completely clean prefix
so you don't get conflicts like this. It might help.

Alan.

On Mon, Jul 13, 2009 at 8:46 PM, cornholio wrote:

>
> Hi Alan,
>
> thank you for your response.
>
> no, i didn't follow the guideline, but i removed my old mono installation a
> few weeks ago (via ubuntu apt-get remove), so i thought i have a clean svn
> installation of mono-svn. it works fine for many days and i did rebuilt the
> sources every day (on 2 systems both are broken now, it's a fault of my
> build-script for sure)
>
> i am downloading the sources from: anonsvn.mono-project.com and i wrote a
> script for checking out /update svn repository and running autogen.sh or
> configure.sh scripts (prefix=/usr/local/).
>
> can you help me how to get rid of the old installation?
>
> thank you
>
>
> Alan McGovern-2 wrote:
> >
> > Hey,
> >
> >
> /usr/local/lib/mono/gac/Mono.Cairo/1.0.5000.0__0738eb9f132ed756/Mono.Cairo.dll
> > (Location of the symbol related to previous error)
> >
> /usr/local/lib/mono/gac/Mono.Cairo/2.0.0.0__0738eb9f132ed756/Mono.Cairo.dll
> >
> > You appear to be loading both the 1.0 and 2.0 Mono.Cairo assemblies at
> the
> > same time, this shouldn't happen and is what is causing the issues. My
> > guess
> > is that you have a broken mono install, as I've been happily compiling
> > monodevelop on a daily basis for the last few months.
> >
> > What commands/arguments did you use to compile mono, gtk and/or
> > monodevelop.
> > Where did you get the source to compile whatever it is you're compiling,
> > what versions of those things are you compiling. Did you follow the
> > guidelines here on how to install a parallel mono without breaking your
> > system: http://www.mono-project.com/Parallel_Mono_Environments.
> >
> > Alan.
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/GTK-Sharp%3A-Cannot-implicitly-convert-type-%60Cairo.Context%27-to-%60Cairo.Context%27-tp24467303p24468067.html
> Sent from the Mono - General mailing list archive at Nabble.com.
>
> ___
> Mono-list maillist  -  Mono-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list


Re: [Mono-list] DllNotFoundException

2009-07-14 Thread Robert Jordan
Mikro Trekker wrote:
> Setting these in Mono cmd prompt (Vista x64) doesn't have any effect on
> debugging. I see nothing when running EXE in Mono... Why ?
> 
> 
> SET MONO_LOG_LEVEL=debug
> SET MONO_LOG_MASK=dll
> 
> mono TEST.exe

mono --debug test.exe

Why? Because your test.exe was compiled with /target:winexe.
Such an exe detaches itself from the console.

Robert

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