[Mono-list] Re: mono-service
Bradley, Peter
PBradley at uwic.ac.uk
Tue Nov 1 11:58:35 EST 2005
"I'm not saying it's *necessary*, simply that it seems the easiest and
most portable solution to me. It's one line of code, and then it should
work under both Mono and .Net without issue. You can move the service
around to your heart's content - so long as the "application.exe.config"
resides in the same directory as the executable, it'll work."
Well, it's at least two lines :) The property has to be set (and once
it's set it can't be re-set, by the way). I'm also not sure whether it
will work under both Windows and Linux, although I am sure it'll work
under both Mono and .NET on Windows. The problem is that the path will
be operating system specific, I think.
Is it possible to test for the OS in code? More lines, but will at
least make the code portable.
As others have pointed out, the config file could reside anywhere using
this method. It doesn't have to be in system32 or in the same directory
as the executable.
The portability of the path worries me a bit: but I need to play with it
a bit, I think.
Cheers
Peter
More information about the Mono-list
mailing list