Re: [Mono-list] How to determine local IP address with mono on linux?

2006-03-23 Thread Elliott Draper
Hi there,

Add a reference to System.Net to the top of your code file (using System.Net; 
), and then try this:

foreach(IPAddress address in 
Dns.GetHostByName(Environment.MachineName).AddressList) {
  Console.WriteLine(address.ToString());
}

That simply prints out each IP address for your local machine to the console, 
however you can do whatever you need to do within that enumeration.

Hope that helps,
-= El =-

On Thu, 23 Mar 2006 17:48:34 +0100, Stephan Eberle [EMAIL PROTECTED] wrote:
 Hi!
 
 How can I enumerate my machines IP addresses with mono on a linux box?
 
 Any info desperately needed! :)
 
 Thank's in advance,
 Stevie
 ___
 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-dev] Problem compiling mono from SVN

2006-01-27 Thread Elliott Draper
Aha, I think I might know why this is. Chris (Toshok) is currently doing lots 
of good work in implementing the .Net 2.0 configuration API within Mono. 
Yesterday he checked-in a load of changes, in a few different commits from what 
I saw in the logs. Seeing as how I refreshed my working copy and compiled 
without issues this morning, could it be that you were just unlucky in when you 
grabbed the code from svn, and that perhaps you got a version of the code with 
some, but not all, of his new changes? 

My best bet would be to svn update your source tree, and try re-compiling 
from scratch, and seeing if that fixes your problem, as I think you might be 
missing some stuff :-)

Let me know how you get on!

Cheers,
Elliott

On Fri, 27 Jan 2006 10:12:22 -0200, Alexandre Rocha Lima e Marcondes
[EMAIL PROTECTED] wrote:
 I have been facing  problems compiling mono from SVN since yesterday.
 
 please, take a look on the messages:
 
 MONO_PATH=../../class/lib/net_2_0:
 $MONO_PATH /home/alexandre/projetos/CSharp/mono/runtime/mono-wrapper 
 ../../gmcs/gmcs.exe /codepage:28591   -d:NET_1_1 -d:NET_2_0 -debug
 /noconfig -unsafe -nowarn:612,649 -r:mscorlib.dll -r:System.dll
 -r:System.Drawing.dll -r:System.Data.dll -r:System.Xml.dll
 -r:System.EnterpriseServices.dll -r:System.Configuration.dll
 -d:CONFIGURATION_2_0 /resource:resources/WebUIValidation.js
 /resource:resources/arrow_minus.gif /resource:resources/arrow_noexpand.gif
 /resource:resources/arrow_plus.gif /resource:resources/arrow_up.gif
 /resource:resources/arrow_down.gif /resource:resources/box_full.gif
 /resource:resources/box_empty.gif /resource:resources/box_minus.gif
 /resource:resources/box_noexpand.gif /resource:resources/box_plus.gif
 /resource:resources/contact.gif /resource:resources/dot_empty.gif
 /resource:resources/dot_full.gif /resource:resources/dots.gif
 /resource:resources/inbox.gif /resource:resources/star_empty.gif
 /resource:resources/star_full.gif /resource:resources/warning.gif
 /resource:resources/TreeView_noexpand.gif
 /resource:resources/TreeView_dash.gif
 /resource:resources/TreeView_dashminus.gif
 /resource:resources/TreeView_dashplus.gif
 /resource:resources/TreeView_i.gif /resource:resources/TreeView_l.gif
 /resource:resources/TreeView_lminus.gif
 /resource:resources/TreeView_lplus.gif
 /resource:resources/TreeView_minus.gif
 /resource:resources/TreeView_plus.gif /resource:resources/TreeView_r.gif
 /resource:resources/TreeView_rminus.gif
 /resource:resources/TreeView_rplus.gif /resource:resources/TreeView_t.gif
 /resource:resources/TreeView_tminus.gif
 /resource:resources/TreeView_tplus.gif /resource:resources/callback.js
 /resource:resources/webform.js
 /resource:System.Web.UI.WebControls/GridView.js
 /resource:System.Web.UI.WebControls/TreeView.js
 /resource:System.Web.UI.WebControls/Menu.js -define:WEBSERVICES_DEP
 -r:System.Web.Services.dll -target:library -out:System.Web.dll 
 @System.Web.dll.sources
 System.Web.Configuration_2.0/SystemWebSectionGroup.cs(210,10): error
 CS0246: The type or namespace name `WebServicesSection' could not be
 found. Are you missing a using directive or an assembly reference?
 System.Web.Mail/MailMessageWrapper.cs(46,10): warning CS0618:
 `System.Web.Mail.MailMessage' is obsolete: `The recommended alternative
 is System.Net.Mail.MailMessage.'
 System.Web.Mail/MailMessageWrapper.cs(50,29): warning CS0618:
 `System.Web.Mail.MailMessage' is obsolete: `The recommended alternative
 is System.Net.Mail.MailMessage.'
 System.Web.Mail/MailMessageWrapper.cs(197,9): warning CS0618:
 `System.Web.Mail.MailFormat' is obsolete: `The recommended alternative
 is System.Net.Mail.MailMessage.IsBodyHtml.'
 System.Web.Mail/MailMessageWrapper.cs(214,9): warning CS0618:
 `System.Web.Mail.MailPriority' is obsolete: `The recommended alternative
 is System.Net.Mail.MailPriority.'
 System.Web.UI.WebControls/BoundField.cs(111,25): warning CS0114:
 `System.Web.UI.WebControls.BoundField.HeaderText' hides inherited member
 `System.Web.UI.WebControls.DataControlField.HeaderText'. To make the
 current member override that implementation, add the override keyword.
 Otherwise add the new keyword
 System.Web.UI.WebControls/DataControlField.cs(308,4)::
 `System.Web.UI.WebControls.DataControlField.HeaderText.set', name of
 symbol related to previous warning
 System.Web.UI.WebControls/RoleGroupCollection.cs(111,15): warning
 CS0114:
 `System.Web.UI.WebControls.RoleGroupCollection.OnValidate(object)' hides
 inherited member `System.Collections.CollectionBase.OnValidate(object)'.
 To make the current member override that implementation, add the
 override keyword. Otherwise add the new keyword
 /home/alexandre/projetos/CSharp/mcs/class/lib/net_2_0/mscorlib.dll:
 `System.Collections.CollectionBase.OnValidate(object)', name of symbol
 related to previous warning
 Compilation failed: 1 error(s), 6 warnings
 make[8]: ** [../../class/lib/net_2_0/System.Web.dll] Erro 1
 
 
 
 --
 Regards,
   Alexandre Rocha Lima e Marcondes
P4 Tecnologia e 

Re: [Mono-dev] [PATCH] System.Configuration.ConfigurationManager

2006-01-26 Thread Elliott Draper
Hi Chris,

Thanks for the response - I saw your plethora of commits, so am about to do a 
fresh checkout, give it a whirl, and I'll let you know ;-)

As for the Assembly.GetCallingAssembly() stuff, when I was looking at it and 
cooked up that patch, the assembly passed in to OpenExeConfigurationInternal 
was only used by the user.config stuff, and I couldn't see where that was 
ever actually being called anywhere else (but then again I didn't even realise 
you could have user.config files in your application data folder, so I left 
that bit well alone :-P).

That's interesting that it looks like web.config and exe.config handling is 
separate, I didn't realise that, as the MS implementation hides it quite 
nicely. I can't think of anything of the top of my head to resolve the usage of 
Assembly.GetCallingAssembly()/GetEntryAssembly(), however if I do think of 
anything I'll let you know.

In the meantime, I'll give the fixes you applied yesterday a go, and keep you 
posted as to how I get on :-)

Cheers,
Elliott


On Thu, 26 Jan 2006 23:47:01 -0500, Chris Toshok [EMAIL PROTECTED] wrote:
 Hey Elliott,
 
 This was definitely something I knew was broken (and so did many others,
 who were bugging me to fix it :)
 
 I ran a few tests on MS's implementation, raised exceptions at the right
 place, and found that most likely the web.config handling was completely
 divorced from from exe.config handling.  I've made some commits tonight
 that should fix most/all of the issues.
 
 I'm still very unhappy with the
 Assembly.GetCallingAssembly()/GetEntryAssembly() crap..  there needs to
 be a better way to do this, but coming up with tests of MS's behavior is
 very hard.
 
 Chris
 
 On Thu, 2006-01-26 at 01:22 +, Elliott Draper wrote:
 Hi guys,

 Attached is a patch for the System.Configuration.ConfigurationManager
 class, that fixes a bug I've found when using the NET-2.0 profile with the
 new configuration objects in a web application. The problem appeared to be
 with how the configuration file name was worked out internally within the
 ConfigurationManager - it appeared to correctly find configuration files
 for console apps etc, but couldn't work out the path to the web.config
 file for a web application. This seemed to result in it simply returning a
 null for custom configuration sections and app settings within web apps.

 The patch tidies that code up a bit, and uses
 AppDomain.CurrentDomain.SetupInformation.ConfigurationFile to retrieve the
 path to the configuration file. I've tested it with a test web app, which
 now can correctly retrieve custom configuration sections, app settings and
 the like. I've also tested a very simple console app to ensure that still
 works, which it does.

 As always, comments welcome, I haven't supplied a test case for this bug
 as it's reproducable by simply trying to retrieve an app setting or
 configuration section when using the NET-2.0 profile
 (xsp2/mod-mono-server2) on the latest version of Mono from svn head,
 however if anyone really wants my test code then give me a shout and I'll
 wrap it up for use elsewhere.

 Oh, and I'm aware that Chris Toshok is actively working on the
 Configuration 2.0 API, and so Chris, if your reading this, your probably
 the most knowledgable person when it comes to this particular bit of code
 - if you've got any comments, if I've missed the point, or if this was
 something that you knew was broken/was broken for a reason/you've fixed
 but haven't checked in yet, then let me know :-)

 Cheers,
 Elliott
 ___ 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-list] ByteFX or Connector/Net or ..?

2006-01-26 Thread Elliott Draper
I've had no problems using the MySql Connector/Net under Mono, in the package 
available from the MySql site 
(http://dev.mysql.com/downloads/connector/net/1.0.html) there are separate 
binaries for .Net 1.0, 1.1, 2.0, and for Mono. I tend to use the .Net 2.0 
binary actually, and that (for me at least) actually works fine when developing 
an app on Windows, running on .Net 2.0, and then deploying it on Linux, using 
the .Net 2.0 profile within the latest version of Mono (1.1.13).

And seeing as how, like you said, the MySql Connector is in fact a continuation 
of the ByteFX provider, then I would use that, as I'd consider the ByteFX 
provider to be deprecated now.

Cheers,
Elliott

On Thu, 26 Jan 2006 08:44:08 +, Paulo Augusto [EMAIL PROTECTED] wrote:
 What should i use to connect to a MySql server? I'm making an aplication
 which i intend to distribute (not personal use).
 
 There seems to be ByteFX.
 The problem is that, the last time i tried to use it, it completely
 failed to connect to the server (mono 1.1.11 in Suse). I was even
 starting to doubt the server was really accepting conections until i
 tried the MySql's Connector/Net for Ms.NET, which worked.
 
 Now, i'm on another system with mono 1.1.13 and, this time, ByteFX seems
 to be working but i don't know if i should trust it to work on all of my
 intended users's systems (most of them probably Windows).
 On the other hand, MySql's Connector/Net for Ms.NET is the
 �continuation� of ByteFX but i'm not completely sure if i
 should trust
 MySql's Connector/Net for Ms.NET since it may have problems working with
 mono.
 
 In this page:
 http://dev.mysql.com/tech-resources/interviews/rburnett.html
 ...
 Reggie, I understand you actually brought Connector/Net with you when
 joining MySQL AB?
 
 Reggie: Yes. I developed the original ByteFX connector, which was
 acquired by MySQL in April '04. It was renamed to Connector/Net,
 ...
 
 Can anyone give some insight on this?
 Sorry if this is asked alot but i don't find usefull information
 regarding this.
 ___
 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


[Mono-dev] [PATCH] System.Web.UI.WebControls.ListControl

2006-01-24 Thread Elliott Draper
Hi guys,

Attached is a patch for everyone's perusal, that fixes a bug in the 
System.Web.UI.WebControls.ListControl class under the NET-2.0 profile, that 
specifically shows itself when using a DropDownList or a ListBox control. It 
appears that modifying the items collection on these controls during a postback 
(adding/removing items on the fly etc in an event handler) causes a problem 
during the next loading of the control state.

It's a bit tricky to write a decent test case for a bug in the web side of 
things, but you can see the problem (at least until I upgrade the Mono classlib 
on my server to include this fix) at a couple of test pages I knocked up, one 
for each control - http://apps.eldiablo.co.uk/TestWebApp/dropdownlisttest.aspx, 
and http://apps.eldiablo.co.uk/TestWebApp/listboxtest.aspx. Attempting to use 
the buttons on these pages to move items from one dropdown or listbox to 
another will result in an ArgumentOutOfRangeException.

Also attached is these two pages (and codebehind) in an archive for anyone who 
wants to try the patch, and try the test pages themselves, to ensure the fix 
works correctly. I've tried the fix against a freshly updated working copy from 
svn on another development box I've got here, and with these same test pages, 
the issue goes away.

It's a fairly small fix, so I don't imagine any problems, but any comments, let 
me know :-)

Cheers,
Elliott

20060124-System.Web.UI.WebControls.ListControl.patch
Description: Binary data


20060124-ListControlTestPages.tar.gz
Description: application/gzip
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-list] IsSubclassOf and Assembly.LoadFrom problem

2006-01-04 Thread Elliott Draper
I'm not entirely sure IsSubclassOf is meant to return true for classes 
implementing an interface? Certainly I've found that it hasn't in the 
past, and instead I use GetInterface() I think it is, passing in the 
name of the interface I'm looking for, and checking to see if that 
returns the interface type, or a null. This would change the code below 
from:


if (t.IsSubclassOf(typeof(a.a))) {

to:

if (t.GetInterface(typeof(a.a).FullName)!=null) {


Maybe someone else can comment on whether or not IsSubclassOf *should* 
be returning true for interfaces, but in the meantime I hope the above 
information should help you out.


Let me know how you get on,
-= El =-

Colin JN Breame wrote:

I've come across this problem before but never solved it (even after searching 
the internet for several hours!).  So I thought I'd ask here


I have two dlls:
a.dll - contains interface a.a
b.dll - contains class b.b that implements a.a

A main program loads b.dll and tests each type in the assembly to find out if 
it implements a.a.  This all works except the class b.b (that I know 
implements a.a) says that it doesn't! e.g. IsSubclassOf returns false.


I think that this might have something to do with AppDomains or some other 
restriction of loading and using types from a dynamically loaded assembly.  
I'm really stuck with this (got that banging my head against a brick wall 
feeling...) so any help would be greatly appreciated.


Below is a test setup if you're wondering what I mean...

Thanks,
-- Colin


a.cs:
namespace a {
 public interface a {
   string hello();
 }
}


b.cs:
namespace b {
 public class b : a.a {
   public string hello() {
 return hello world;
   }
 }
}


main.cs:
using System;
using System.Reflection;

namespace test {
 public class test {
   public static void Main() {
 Assembly a = Assembly.LoadFrom(b.dll);

 Type[] types = a.GetTypes();
 foreach (Type t in types) {
   if (t.IsSubclassOf(typeof(a.a))) {
 Console.WriteLine({0} is a subclass of {1}, t, typeof(a.a));
   } else {
 Console.WriteLine({0} is not a subclass of {1}, t, typeof(a.a));
   }
 }
   }
 }
}


build.sh:
mcs -target:library -out:a.dll a.cs 
mcs -target:library -out:b.dll -r:a.dll b.cs 
mcs -out:test.exe -r:a.dll test.cs
___
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] MySQL Connector.Net

2005-12-01 Thread Elliott Draper

http://dev.mysql.com/downloads/connector/net/1.0.html

On this page you'll find the cunningly titled Windows Source and 
Binaries, no installer (ZIP), which I presume is what you were talking 
about. In actual fact if you download the zip file, within the bin 
folder, you'll find a mono-1.0 folder containing binaries for use with 
Mono. There are also folders containing binaries for .Net 1.0/1.1/2.0. 
No idea why they specifically called it Windows Source and Binaries, 
as I don't see any reason why the Mono.Data.dll assembly within 
mono-1.0 won't work for you on RHEL4.


Let me know how that works out for you.

Cheers,
-= El =-

Kurt Leyba wrote:


Hello;
 
I just installed mod_mono module for apache on redhat enterprise 4 and 
asp is working great. I need to get is to interface with a MySQL 
database. I read that I need to install the  Connector.Net package but 
all I can find is the windows binaries.
 
Any help?
 
Thanks,
 
Kurt




___
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] MySQL Connector.Net

2005-12-01 Thread Elliott Draper
The guy that wrote the ByteFX provider actually got hired by MySql, and 
so I can only presume the MySql .Net Connector is in fact a re-packaged 
ByteFX provider, that's kept up to date and in-line with MySql releases. 
I don't believe therefore that ByteFX is still maintained separately.


Is it possible you can give me a little bit more information on the 
error your application gets when built using the MySql.Data assembly? 
This might allow me or someone else on this list to try and work out 
exactly what's going on :-)


Cheers,
-= El =-

giovanni francesco lucchese wrote:


2005/12/1, Elliott Draper [EMAIL PROTECTED]:
 


http://dev.mysql.com/downloads/connector/net/1.0.html

On this page you'll find the cunningly titled Windows Source and
Binaries, no installer (ZIP), which I presume is what you were talking
about. In actual fact if you download the zip file, within the bin
folder, you'll find a mono-1.0 folder containing binaries for use with
Mono. There are also folders containing binaries for .Net 1.0/1.1/2.0.
No idea why they specifically called it Windows Source and Binaries,
as I don't see any reason why the Mono.Data.dll assembly within
mono-1.0 won't work for you on RHEL4.

Let me know how that works out for you.

Cheers,
-= El =-

Kurt Leyba wrote:

   


Hello;

I just installed mod_mono module for apache on redhat enterprise 4 and
asp is working great. I need to get is to interface with a MySQL
database. I read that I need to install the  Connector.Net package but
all I can find is the windows binaries.

Any help?

Thanks,

Kurt



___
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

   



The connectors work, but I can't create an application with Winforms
(using as resource the dll System.Windows.Forms of Mono and
MySql.Data.dll of MySql)..if I don't use db the gui works... I know
there are other connectors by ByteFX but i've never used
them(sorry for my bad english).ciao
--
Giovanni Francesco Lucchese
___
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-dev] Can I use mod_mono with xsp2

2005-11-19 Thread Elliott Draper

Joe Audette wrote:

Is it possible to use the new 2.0 ASP.NET features that are currently 
implemented in mono with mod_mono on apache2? Or can it only be done 
using xsp2 from the command line?


What do I have to configure differently to make this happen?
I'm using Virtual Hosts in apache.


Check this out: http://www.mono-project.com/Mod_mono#Paths

You'll see that you can use MonoServerPath to specify the actual 
ModMono executable used, and instead of using the default one, you can 
use $MONO/lib/mono/2.0/mod-mono-server2.exe to target the 2.0 profile 
(where $MONO is the path to your Mono installation).




Can I make a new Virtual Host that is configured for ASP.NET 2.0 or 
xsp2/mod_mono while leaving the other Virtual Hosts running under the 
regular 1.1 implementation of xsp/mod_mono?


Not sure on this, but I would think you can specify different 
MonoServerPath settings for different vhosts.




If so any tips or links on how to do it would be much appreciated.

*snip*

I have a copy of mojoportal compiled in VS 2005 and I am trying to get 
setup so I can test it on my mono machine. It doesn't use any of the 
ASP.NET 2.0 features but it was compiled on Windows against the 2.0 
framework.


Cool!



Anyone else done any testing of building a web app in VS 2005 and able 
to get it running on mod_mono/apache2?


I write all of my apps at the minute using VS2005, and am finding it 
easy to port most apps to using the Mono 2.0 profile, so that I can take 
advantage of 2.0 features. I had a tough time using web apps created 
under VS2005 using Mono a while back though, so took to (where possible) 
back porting them to 1.1, removing partial classes, and obviously this 
was only possible for projects not using or referencing 2.0 features 
like generics etc. This did however get my web apps built using VS2005 
running on mod_mono!


I haven't retried straight porting a 2.0 app created with VS2005 in a 
while tho, when I get more time I hope to give it another bash; I'm sure 
with a lot of the recent updates to the codebase I should have more luck 
:-) Let me know how you get on!




Thanks,


Hope that helps!



Joe


Cheers,
-= El =-




joe_audette [at] yahoo dotcom
http://www.joeaudette.com
http://www.mojoportal.com



___
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-list] Scripting the Linux OS with Mono

2005-11-11 Thread Elliott Draper
 = null;

try
{
//Compile our script to an assembly
assembly = CompileFile();

//Ensure we have an assembly
if (assembly == null)
throw new Exception(No assembly generated!);
}
catch (Exception ex)
{
//Display any errors found while compiling
Console.WriteLine(string.Format(
Exception caught while compiling script:{0}{1}{0},
Environment.NewLine,
ex.ToString()));

return;
}

//If we are only validating (compiling) the script, then exit here
if (Options.ValidateOnly)
{
Console.WriteLine(Validation complete);
return;
}

try
{
//Execute the script
ExecuteAssembly(assembly);
}
catch (Exception ex)
{
//Catch any errors while executing it
Console.WriteLine(string.Format(
Exception caught while executing script:{0}{1}{0},
Environment.NewLine,
ex.ToString()));

return;
}
}

/// summary
/// This outputs the program logo
/// /summary
static void Logo()
{
Console.WriteLine(MonoScript: (c) 2005, Elliott Draper [EMAIL 
PROTECTED]);
}

/// summary
/// This outputs the usage of the app
/// /summary
static void Usage()
{
Console.WriteLine(Usage: MonoScript --sourceFile:[VALUE] [ARGS] 
where [ARGS] can optionally be one of the following:);
Console.WriteLine(--references:[VALUE], -r:[VALUE], /r:[VALUE] 
:   any references needed to compile the script);
Console.WriteLine(--noLogo:[VALUE], -n:[VALUE], /n:[VALUE] 
:   stops from showing the MonoScript logo);
Console.WriteLine(--displayUsage:[VALUE], -d:[VALUE], /d:[VALUE]   
:   displays this usage info);
Console.WriteLine(--validateOnly:[VALUE], -v:[VALUE], /v:[VALUE]   
:   validates the script by compiling it, but doesn't execute it);
}

/// summary
/// This compiles the specified file into an assembly, exceptioning on 
error
/// /summary
/// returns/returns
static Assembly CompileFile()
{
//Setup the parameters
CompilerParameters parameters = new CompilerParameters();
foreach (string reference in Options.References)
parameters.ReferencedAssemblies.Add(reference);
parameters.GenerateInMemory = true;

//Create the provider and compiler
CodeDomProvider provider = new 
Microsoft.CSharp.CSharpCodeProvider();
if (provider == null)
throw new Exception(Cannot create C# code provider!);
ICodeCompiler compiler = provider.CreateCompiler();
if (compiler == null)
throw new Exception(Cannot create C# compiler!);
//Compile the file with the specified parameters
CompilerResults results = compiler.CompileAssemblyFromFile(
parameters,
Options.SourceFile);
//Grab and validate the results
if (results == null)
throw new Exception(Could not retrieve results from 
compilation!);
if (results.Errors.HasErrors)
throw new Exception(results.Errors[0].ErrorText);
//Return the compiled assembly
return results.CompiledAssembly;
}

/// summary
/// This executes the specified compiled assembly
/// /summary
/// param name=assembly/param
static void ExecuteAssembly(Assembly assembly)
{
//Invoke the entry point found for the assembly, with the specified 
arguments
GetEntryPoint(assembly).GetMethod(Main).Invoke(null, new 
object[1] { Options.ScriptArgs });
}

/// summary
/// This attempts to locate a type with a static Main method within 
the generated script assembly
/// /summary
/// param name=assembly/param
/// returns/returns
static Type GetEntryPoint(Assembly assembly)
{
//Loop through all of the generated types
foreach (Type type in assembly.GetTypes())
{
//If we find one that has a static Main method, lets return it
if (type.GetMethod(Main) != null  
type.GetMethod(Main).IsStatic)
return type;
}
//If we get to here, we got no entry point :-(
throw new Exception(Unable to find a class with a valid entry 
point within the script

Re: [Mono-list] Re: mono-service

2005-11-01 Thread Elliott Draper

Bradley, Peter wrote:


I wonder if I might be forgiven for responding to myself in order to ask one 
(hopefully final) question about mono-service?

Following the discussion here, I checked out some Windows services I've written and 
everything seems fine except for one thing.  The services I write are to host remote 
objects.  As a matter of policy we configure .NET remoting using configuration files.  
Therefore host services contain a call to 
RemotingConfiguration.Configure(config.file.name).

Under Windows, the config file must be copied to the WINDOWS\System32 (or 
WINNT\System32) directory for it to be found by the service.  Where should the 
config file be located under Mono in order for the daemon to find it?
 

You don't have to place the config files in System32 for them to be 
found, you can give a full path to the call to 
RemotingConfiguration.Configure. I find the easiest way is to stick your 
remoting config in with any other configuration you might have within an 
application configuration file ($assemblyname.config). Are you 
familiar with these? Just in case...
   If using Visual Studio, you can add a new Application Configuration 
file to your project (app.config), and place all config in there. At 
compile time, a built-in build event will take care of copying this file 
to your bin directory, and re-naming it $assemblyname.config, for 
example, myservice.exe.config.
   If your not using Visual Studio, then you can manage the config file 
however you want, however it needs to end up in the same directory as 
your executable, named the same as your executable but with .config on 
the end, e.g. myservice.exe.config. I tend to have an App.config in 
the root of my executables project, and I get NAnt to copy the file over 
to my bin directory and re-name it at compile time, just like VS.


Either way, once you have your correctly named configuration file 
residing within the same directory as your executable, your call to 
RemotingConfiguration.Configure becomes nice and easy:


   
RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);


This grabs the full path of the configuration file from the current app 
domain, and should load your remoting configuration without problems. 
You can then move the service around without issue, providing that the 
config file stays with the executable ;-)


AFAIK this works just as well on Mono as it does on .Net.


Thanks for your patience.


Peter
 


Hope that helps!

-= El =-



-Original Message-
From: Jörg Rosenkranz [mailto:[EMAIL PROTECTED] 
Sent: 01 November 2005 12:52

To: Bradley, Peter; Robert Jordan; mono-list@lists.ximian.com
Subject: RE: [Mono-list] Re: mono-service

Hi Peter,

 


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
Bradley, Peter

Sent: Tuesday, November 01, 2005 1:26 PM

My post was not intended as a criticism of the man page, and I'm very
sorry if it appeared to be so.  Perhaps I should have been 
clearer, but

what I was really saying that what (I think) is needed is a HowTo.
   



Yes I think this is true. There needs to be something in the Wiki.

To answer some of your questions:

 


Does the process to be run as a daemon have to inherit from
System.ServiceProcess.ServiceBase?  Does it guarantee that the
OnStart(), OnStop(), OnPause(), and OnContinue() methods get called as
appropriate?  
   



The service has to be implemented according to the MS docs:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemserviceprocessservicebaseclasstopic.asp
and
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemserviceprocessservicebaseclassruntopic1.asp

Short: It needs to be inherited from ServiceBase and it needs to call 
ServiceBase.Run in it's Main method.


 

What does one have to do make the service start 
up at boot
time and run without a user logged in?  (Your script is a 
great help in
that regard.  Thanks).  What user does the service run as?  
   



It runs as the user you are starting mono-service with. You
are responsible for switching the user in the start script.
Examples of start scripts should be in the Wiki/Doc/etc. too.
Maybe that's tootoo distribution specific to put it into SVN?

 


What changes
(if any) are required to assemblies written as Windows 
services to make

sure they can run as daemons?
   



There are no changes needed if the assemblies are written
with the normal portability rules in mind. Mono-service 
should mimic the behaviour of MS' implementation as close 
as possible.


 

The OP obviously has trouble getting the OnStart() method 
running.  The

reason why might be contained in the answers to the questions I make
above.
   



Yes :-)

 


I'm perfectly happy to put my money where my mouth is as far as
producing a HowTo is concerned.  Once I've got a daemon 
running, I'll be

only too happy to explain how it was done.  But I 

Re: [Mono-list] Re: mono-service

2005-11-01 Thread Elliott Draper

Bradley, Peter wrote:


Sorry Elliott,

I'm not sure what you're saying here.  Given the documentation I quoted, are 
you saying that under Mono it is necessary to use:

RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);

if I want to use the same code on both Mono and Windows?
 

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.



Or are you saying the documentation is wrong and that a simple absolute path 
will do the trick - despite what the books say ;) - under both systems?
 

Well I'd hate to go out and say it's wrong, but certainly some of the 
advice seems a little funky, and like Rob mentioned in his post, the 
putting of the remoting config into system32 seems a little weird. 
Could it just be that these are books referring to the .Net framework 
v1.0, and maybe these are things that have been revised in v1.1 perhaps?



I haven't tried using an absolute path for the app.config file of a Windows 
service (as opposed to a server or an ordinary executable), for the reasons I 
gave: but if you're convinced it works then I'll give it a go.
 

I'd give the above line a shot; it's one line of code, where's the harm 
in that? ;-)



Cheers


Peter
 


-= El =-


-Original Message-
From: Elliott Draper [mailto:[EMAIL PROTECTED] 
Sent: 01 November 2005 13:49

To: Bradley, Peter
Cc: mono-list@lists.ximian.com
Subject: Re: [Mono-list] Re: mono-service

Bradley, Peter wrote:

 


I wonder if I might be forgiven for responding to myself in order to ask one 
(hopefully final) question about mono-service?

Following the discussion here, I checked out some Windows services I've written and 
everything seems fine except for one thing.  The services I write are to host remote 
objects.  As a matter of policy we configure .NET remoting using configuration files.  
Therefore host services contain a call to 
RemotingConfiguration.Configure(config.file.name).

Under Windows, the config file must be copied to the WINDOWS\System32 (or 
WINNT\System32) directory for it to be found by the service.  Where should the 
config file be located under Mono in order for the daemon to find it?


   

You don't have to place the config files in System32 for them to be 
found, you can give a full path to the call to 
RemotingConfiguration.Configure. I find the easiest way is to stick your 
remoting config in with any other configuration you might have within an 
application configuration file ($assemblyname.config). Are you 
familiar with these? Just in case...
   If using Visual Studio, you can add a new Application Configuration 
file to your project (app.config), and place all config in there. At 
compile time, a built-in build event will take care of copying this file 
to your bin directory, and re-naming it $assemblyname.config, for 
example, myservice.exe.config.
   If your not using Visual Studio, then you can manage the config file 
however you want, however it needs to end up in the same directory as 
your executable, named the same as your executable but with .config on 
the end, e.g. myservice.exe.config. I tend to have an App.config in 
the root of my executables project, and I get NAnt to copy the file over 
to my bin directory and re-name it at compile time, just like VS.


Either way, once you have your correctly named configuration file 
residing within the same directory as your executable, your call to 
RemotingConfiguration.Configure becomes nice and easy:


   
RemotingConfiguration.Configure(AppDomain.CurrentDomain.SetupInformation.ConfigurationFile);


This grabs the full path of the configuration file from the current app 
domain, and should load your remoting configuration without problems. 
You can then move the service around without issue, providing that the 
config file stays with the executable ;-)


AFAIK this works just as well on Mono as it does on .Net.

 


Thanks for your patience.


Peter


   


Hope that helps!

-= El =-

 


-Original Message-
From: Jörg Rosenkranz [mailto:[EMAIL PROTECTED] 
Sent: 01 November 2005 12:52

To: Bradley, Peter; Robert Jordan; mono-list@lists.ximian.com
Subject: RE: [Mono-list] Re: mono-service

Hi Peter,



   


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
Bradley, Peter

Sent: Tuesday, November 01, 2005 1:26 PM

My post was not intended as a criticism of the man page, and I'm very
sorry if it appeared to be so.  Perhaps I should have been 
clearer, but

what I was really saying that what (I think) is needed is a HowTo.
  

 


Yes I think this is true. There needs to be something in the Wiki.

To answer some of your questions:



   


Does the process

Re: [Mono-list] Re: mono-service

2005-11-01 Thread Elliott Draper

Bradley, Peter wrote:


Robert,

*snip*

OK.  I'll play with that.  The property has to be set, of course, which
means hard coding a path into code, which is something I like to avoid
where I can, but it doesn't seem too much of a risk in this situation.
Thank you.
 

That property doesn't have to be set, it's something you get for free. 
The AppDomain is created and setup presumably by the runtime when your 
program launches, and it will automatically pick up the path to your 
configuration file, providing it is named the same as your executable, 
with .config on the end, e.g. myapplication.exe.config. In this way, 
you don't have to hard code any path into the code, that's what makes it 
so portable :-)



Cheers


Peter
 


-= El =-


___
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] Reflection odd exception

2005-10-19 Thread Elliott Draper
I'd hazard a guess and say it's because you don't have a reference to 
the relevant Gdk assemblies, or they can't be found in the path, gac 
etc. As such when it's creating this object, it's coming unstuck because 
that class is using a type that it can't find, hence when you change it 
to using types it can find (object, EventArgs), there's no problem.


Either way, you can check the inner exception of that exception to get 
the exact error. It'll tell you in there what the problem is, and 
whether it is in fact a problem with the call using that type, or 
whether I'm way off the mark and it's something completely different :-)


Let me know how you get on.

Cheers,
-= El =-

Carlos Ble wrote:


Hi!
Iam working with reflection by loading some clases dinamically. This is
a piece of pseudo code:
System.Object[] paramsObj = new System.Object[] {...params...};
Assembly assembly = Assembly.GetExecutingAssembly();
System.Object childWin =   
 AppDomain.CurrentDomain.CreateInstanceAndUnwrap(assembly.FullName,
 managerClass,true, BindingFlags.Instance|BindingFlags.Public,

 null, paramsObj, null, null, null);

Everything works fine but one of the classes to load has this method:

bool OnWinDeleteEvent (Gdk.Event e) // Instead of (object o, EventArgs
e).
{
 ...
 return true;
}

I can compile all successfull but in runtime, CreateInstanceAndUnwrap
call launchs this exception: 


Exception has been thrown by the target of an invocation.
in 0x0010e System.Reflection.MonoCMethod:Invoke (System.Object obj,
BindingFlags invokeAttr, System.Reflection.Binder binder,
System.Object[] parameters, System.Globalization.CultureInfo culture)
in 0x0001c System.Reflection.MonoCMethod:Invoke (BindingFlags
invokeAttr, System.Reflection.Binder binder, System.Object[] parameters,
System.Globalization.CultureInfo culture)
in 0x00200 System.Activator:CreateInstance (System.Type type,
BindingFlags bindingAttr, System.Reflection.Binder binder,
System.Object[] args, System.Globalization.CultureInfo culture,
System.Object[] activationAttributes)
in 0x0005b System.Activator:CreateInstance (System.String
assemblyName, System.String typeName, Boolean ignoreCase, BindingFlags
bindingAttr, System.Reflection.Binder binder, System.Object[] args,
System.Globalization.CultureInfo culture, System.Object[]
activationAttributes, System.Security.Policy.Evidence securityInfo)
in 0x0002d System.AppDomain:CreateInstance (System.String
assemblyName, System.String typeName, Boolean ignoreCase, BindingFlags
bindingAttr, System.Reflection.Binder binder, System.Object[] args,
System.Globalization.CultureInfo culture, System.Object[]
activationAttributes, System.Security.Policy.Evidence
securityAttributes)
in (wrapper remoting-invoke-with-check) System.AppDomain:CreateInstance
(string,string,bool,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo,object[],System.Security.Policy.Evidence)
in 0x0002e System.AppDomain:CreateInstanceAndUnwrap (System.String
assemblyName, System.String typeName, Boolean ignoreCase, BindingFlags
bindingAttr, System.Reflection.Binder binder, System.Object[] args,
System.Globalization.CultureInfo culture, System.Object[]
activationAttributes, System.Security.Policy.Evidence
securityAttributes)
in (wrapper remoting-invoke-with-check)
System.AppDomain:CreateInstanceAndUnwrap
(string,string,bool,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo,object[],System.Security.Policy.Evidence)

If I change arguments to (object o, EventArgs e), it works fine. Can
somebody write some comments about this behaviour?.

Thanks


___
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


[Mono-list] Problem with Mono website?

2005-10-07 Thread Elliott Draper

Guys,

Is something up with the Mono website at the minute? When I try to visit 
http://www.mono-project.com, I'm being greeted with what looks like the 
main http://www.novell.com website, but without the style sheet. If it 
helps, pinging www.mono-project.com resolves to 
redirector.novell.com, with an IP of 130.57.4.70.


Something funny going on?

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


[Mono-list] Amber Communications Framework

2005-09-01 Thread Elliott Draper

Hello everyone,

A while back, I joined the development team of a project that was then 
called MonoIndigo. This was designed to be a port of Microsoft's 
Indigo framework (now known as the Windows Communication Foundation). As 
many of you know, Microsoft made it clear that any kind of direct port 
of Indigo was not going to be accepted, and would be in breach of IP 
regulations. Likewise, the same would apply for Avalon (now known as the 
Windows Presentation Foundation I believe).


  The main aim of that project, was to EXTEND Indigo's appeal, by 
making the same code, unchanged, run on any platform that Mono run's on. 
Seeing as this can no longer be the case, the project was changed, 
re-named, and is no longer a direct port of Indigo. I personally feel we 
are lacking a decent, service oriented framework for helping to develop 
client/server applications under Mono, and I would like still to rectify 
that with the Amber project. It's main aim is to make a functional 
useful messaging and communication platform, running under either 
.Net/Mono, that takes the hassle out of writing the actual communication 
layer of a server/client app, allowing the developer to rely on the 
framework to perform the communications, while they concentrate on the 
specifics of his/her application.


Anyway, enough waffle, the point of this e-mail is simply to see if 
anyone else would be interested in working on such an open source 
effort, as currently our development team is severely lacking, and with 
our current resources it'll take us years to get to any kind of point 
where we are able to release! So if any like-minded individuals are up 
for helping to build a decent communications platform, hopefully 
benefitting the community, and meanwhile providing a worthy rival to the 
Microsoft Windows Communication Foundation, then please get in contact 
with me, the more the merrier! We'll need developers, testers, people to 
help with documentation, etc...


In the meantime, here are a few project links:
-- A wiki I setup for the project: 
http://wiki.eldiablo.co.uk/amber/FrontPage
-- The project page on NovellForge: 
http://forge.novell.com/modules/xfmod/project/?amber


Any questions, discussion, whatever, don't hesitate to drop me a mail.

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


Re: [Mono-list] Capturing output from Linux Command Line programs

2005-08-16 Thread Elliott Draper

[EMAIL PROTECTED] wrote:


Hi,

   


Yes you can, and this has nothing to do with what I am trying to do.
Please read my original post. My problem has absolutely nothing to do
with capuring output from MY program.

I'm trying to capture output from existing linux Command Line program
like wget, mkisofs and others, so I can use that output in a GUI application.
 


The method described should work for *any* command line application -
try it. You may be surprised.

TTFN

Paul
   




I doubt it, I use that method quite a bit. It however does not answer
my need. It also does not explain why System.Diagnostics.Process does
not seem to function as expected, and it does not give me a real time
feed of the output from a Linux command line program, like wget to my
GUI application.

So I'm am not in the least interested in reading about one can redirect
stdout using the redirect  on the command line works. You can do
that until the cows come home, and it still won't solve my problem.

Anyone want to tell me how I can interact with a command line program
like say cdrecord in the same way that X-CD-Roast does, but using Mono
and C#.

regards

Tracy Barlow

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

 

What's wrong with firing off a System.Diagnostics.Process that executes 
it, and reading the output from the StandardOutput stream on the 
process? You say that Process does not seem to function as expected; 
howso?


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


[Mono-dev] Problem building from source

2005-08-13 Thread Elliott Draper

Hi all,

I've recently been having trouble building Mono from source (either the 
source tarball, or from SVN) on one box I've got. I've built from source 
countless times on other boxes without issues, but this one is being a 
pain in the ass. Attached is the output from when I execute 
./autogen.sh --prefix=/usr/local/mono within the mono directory.


I'm using Autoconf v2.59, and Automake v1.9.2. These versions match that 
of another machine I have, which builds from source correctly. The only 
problem I can see with it is that I did have to update Autoconf as it 
was previously an older version. The errors I'm getting seem to suggest 
some kind of autoconf symbol error, is there any kind of cache I need to 
manually refresh after upgrading autoconf to the latest version, before 
it'll properly take effect?


If that's not the problem, any ideas what might be? This one has me 
totally perplexed at the minute, and looking for some of the symbol 
error messages given in the attached output on Google and the like 
throws up lots of results, none of which appear relevant to this situation.


Any help would be muchly appreciated, if anyone needs more information, 
let me know.


Cheers,
-= El =-
Running libtoolize...
You should update your `aclocal.m4' by running aclocal.
Running aclocal  ...
aclocal:configure.in:258: warning: macro `AM_PROG_LIBTOOL' not found in library
Running autoheader...
autoheader: WARNING: Using auxiliary files such as `acconfig.h', `config.h.bot'
autoheader: WARNING: and `config.h.top', to define templates for `config.h.in'
autoheader: WARNING: is deprecated and discouraged.
autoheader:
autoheader: WARNING: Using the third argument of `AC_DEFINE' and
autoheader: WARNING: `AC_DEFINE_UNQUOTED' allows to define a template without
autoheader: WARNING: `acconfig.h':
autoheader:
autoheader: WARNING:   AC_DEFINE([NEED_FUNC_MAIN], 1,
autoheader: [Define if a function `main' is needed.])
autoheader:
autoheader: WARNING: More sophisticated templates can also be produced, see the
autoheader: WARNING: documentation.
Running automake --gnu  ...
ikvm-native/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
ikvm-native/Makefile.am:4:
ikvm-native/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
ikvm-native/Makefile.am:4: to `configure.in' and run `aclocal' and `autoconf' 
again.
mono/arch/Makefile.am:7: Libtool library used but `LIBTOOL' is undefined
mono/arch/Makefile.am:7:
mono/arch/Makefile.am:7: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/Makefile.am:7: to `configure.in' and run `aclocal' and `autoconf' 
again.
mono/arch/alpha/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/alpha/Makefile.am:4:
mono/arch/alpha/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/alpha/Makefile.am:4: to `configure.in' and run `aclocal' and 
`autoconf' again.
mono/arch/amd64/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/amd64/Makefile.am:4:
mono/arch/amd64/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/amd64/Makefile.am:4: to `configure.in' and run `aclocal' and 
`autoconf' again.
mono/arch/arm/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/arm/Makefile.am:4:
mono/arch/arm/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/arm/Makefile.am:4: to `configure.in' and run `aclocal' and `autoconf' 
again.
mono/arch/hppa/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/hppa/Makefile.am:4:
mono/arch/hppa/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/hppa/Makefile.am:4: to `configure.in' and run `aclocal' and 
`autoconf' again.
mono/arch/ppc/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/ppc/Makefile.am:4:
mono/arch/ppc/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/ppc/Makefile.am:4: to `configure.in' and run `aclocal' and `autoconf' 
again.
mono/arch/s390/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/s390/Makefile.am:4:
mono/arch/s390/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/s390/Makefile.am:4: to `configure.in' and run `aclocal' and 
`autoconf' again.
mono/arch/s390x/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/s390x/Makefile.am:4:
mono/arch/s390x/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/s390x/Makefile.am:4: to `configure.in' and run `aclocal' and 
`autoconf' again.
mono/arch/sparc/Makefile.am:4: Libtool library used but `LIBTOOL' is undefined
mono/arch/sparc/Makefile.am:4:
mono/arch/sparc/Makefile.am:4: The usual way to define `LIBTOOL' is to add 
`AC_PROG_LIBTOOL'
mono/arch/sparc/Makefile.am:4: to `configure.in' and run `aclocal' and 
`autoconf' again.

[Mono-devel-list] [PATCH] MCS Spelling Mistake

2005-08-03 Thread Elliott Draper

Hi all,

Not a big problem, but nice and easy to fix; this corrects a spelling 
error in the errors displayed by the compiler (mcs/gmcs) when a strong 
name key file is specified, but it is either invalid, or missing. I got 
it the other day when I specified the path to a strong name key file 
incorrectly, and I thought I'd fix it when I got the chance, before I 
forgot about it.


Patch attached.

Regards,
-= El =-
Index: mcs/ChangeLog
===
--- mcs/ChangeLog   (revision 47981)
+++ mcs/ChangeLog   (working copy)
@@ -1,3 +1,7 @@
+2005-08-03  Elliott Draper   [EMAIL PROTECTED]
+   Fixed a spelling mistake in errors thrown by the compiler for a 
missing/invalid strong name key file when building an assembly.
+   * codegen.cs: Replaced speficied with specified.
+
 2005-08-03  Raja R Harinath  [EMAIL PROTECTED]
 
First cut of the qualified-alias-member feature.
Index: mcs/codegen.cs
===
--- mcs/codegen.cs  (revision 47981)
+++ mcs/codegen.cs  (working copy)
@@ -1046,7 +1046,7 @@
}
}
catch (Exception) {
-   Error_AssemblySigning (The speficied file ` + 
RootContext.StrongNameKeyFile + ' is incorrectly encoded);
+   Error_AssemblySigning (The specified file ` + 
RootContext.StrongNameKeyFile + ' is incorrectly encoded);
Environment.Exit (1);
}
}
@@ -1152,7 +1152,7 @@
ECMA 
key can only be used to delay-sign assemblies);
}
else {
-   
Error_AssemblySigning (The speficied file ` + RootContext.StrongNameKeyFile + 
' does not have a private key);
+   
Error_AssemblySigning (The specified file ` + RootContext.StrongNameKeyFile + 
' does not have a private key);
}
return null;
}
@@ -1160,7 +1160,7 @@
}
}
else {
-   Error_AssemblySigning (The speficied file ` + 
RootContext.StrongNameKeyFile + ' does not exist);
+   Error_AssemblySigning (The specified file ` + 
RootContext.StrongNameKeyFile + ' does not exist);
return null;
}
return an;
Index: gmcs/ChangeLog
===
--- gmcs/ChangeLog  (revision 47981)
+++ gmcs/ChangeLog  (working copy)
@@ -1,3 +1,7 @@
+2005-08-03  Elliott Draper   [EMAIL PROTECTED]
+   Fixed a spelling mistake in errors thrown by the compiler for a 
missing/invalid strong name key file when building an assembly.
+   * codegen.cs: Replaced speficied with specified.
+
 2005-08-03  Martin Baulig  [EMAIL PROTECTED]
 
Make iterators in generic methods work; see gtest-191.cs.
Index: gmcs/codegen.cs
===
--- gmcs/codegen.cs (revision 47981)
+++ gmcs/codegen.cs (working copy)
@@ -1062,7 +1062,7 @@
}
}
catch (Exception) {
-   Error_AssemblySigning (The speficied file ` + 
RootContext.StrongNameKeyFile + ' is incorrectly encoded);
+   Error_AssemblySigning (The specified file ` + 
RootContext.StrongNameKeyFile + ' is incorrectly encoded);
Environment.Exit (1);
}
}
@@ -1167,7 +1167,7 @@
ECMA 
key can only be used to delay-sign assemblies);
}
else {
-   
Error_AssemblySigning (The speficied file ` + RootContext.StrongNameKeyFile + 
' does not have a private key);
+   
Error_AssemblySigning (The specified file ` + RootContext.StrongNameKeyFile + 
' does not have a private key);
}
return null;
}
@@ -1175,7 +1175,7

Re: [Mono-list] Simple Window Form can not be showed in Solaris

2005-07-28 Thread Elliott Draper

Huaiyang Mao wrote:


Hello,

I have installed mono 1.1.8.2 in Solaris and can compile the following
code with mcs -r:System.Windows.Forms Test.cs successfully. I tried
to start it mono Test.exe, but I could not get the simple Windows
Form showed. Could you help me to solve the problem? Many thanks.

--
using System;
using System.Collections;
using System.ComponentModel;

namespace client
{
 public class SimpleForm
 {
   private System.ComponentModel.Container components = null;

   [STAThread]
   static void Main() 
   {

 Application.Run(new SimpleForm());
   }

   public SimpleForm()
   {
   }
 }
}
___
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

 

Your almost there, you just need to make your SimpleForm class inherit 
from a Windows form, by adding using System.Windows.Forms; to the 
using declarations at the top, and then change the line

public class SimpleForm
to read:
public class SimpleForm: Form

This now means that your simple form class is derived from a Form, and 
when the app is run, it will create and display your basic blank form.


Hope that helps,

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


Re: [Mono-devel-list] Interactive C# prompt

2005-07-19 Thread Elliott Draper

Colin JN Breame wrote:


Hello,

I'm wondering whether there is such a thing as an interactive C# prompt for 
mono. e.g. where commands can be entered and executed one-by-one.


If not, any ideas about how I would go about writting something like this?
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

 


Hi,

Are you referring to a way to execute small C# code statements and have 
them executed as if they were within a simple program, on the fly? 
Because if so, then you can use the classes and methods within 
System.CodeDom, specifically within System.CodeDom.Compiler, to compile 
and execute code. So you can take a command such as 
string.Compare(test,testing) from a prompt, build it up into a 
simple class with an entry point, use an ICodeCompiler object (which one 
depends on which language) to compile the code, and then execute the 
assembly in memory, returning the result back to the prompt (without 
saving any of the code or binary assembly to file, truly on the fly). 
This leaves you with a basic eval prompt for running simple statements, 
in whatever .Net language you choose to support using different 
ICodeCompiler's. You could ofcourse get as complicated as you like in 
building up the program to execute, depending on how much information 
you want to let the user enter straight from the command line, from 
simple statements to full code blocks.


I have actually started working on a DotNet/Mono written shell named 
xSh, for both Windows and Linux, and one of the plugins I'm going to 
incorporate will be a simple C# code evaluator for running simple 
functions and simple bits of code off the command line. I hope to have a 
beta release out fairly soonish.


If this was what your after and you'd like more info, or a code sample, 
just let me know.


Oh and if I'm way off base and this isn't what you wanted... then ignore 
my ramblings :-)


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


Re: [Mono-list] Mono Web Services

2005-06-29 Thread Elliott Draper

Hi there,

You need to add a reference to the System.Web.Services assembly as it 
must be using that within the class.


Try:

mcs /target:library GoogleSearchService.cs -r:System.Web.Services

Incidentally, when I tried to compile a file that required this 
assembly, without it, as a test, the compiler gave me the below error 
(aswell as the one you quoted), that helpfully informed me that I should 
add a reference to System.Web.Services :-)


test.cs(1) error CS0246: The namespace `System.Web.Services' can not be 
found (m

issing assembly reference?)
   Try using -r:System.Web.Services

I assumed that was the problem from your error message, but that's 
pretty clever, I didn't realise it did that.


Regards,
-= El =-


Tarun R wrote:


Hi,
I recently tried using Google web APIs and got their WSDL file.
I made it into a C# file using Mono WSDL toolkit.
When I tried building the library, it gave an error:

The command I entered was:
$mcs /target:library GoogleSearchService.cs

The result was:
$GoogleSearchService.cs(20) error CS0234: The type or namespace name 
`Services' could not be found in namespace `System.Web'

Compilation failed: 1 error(s), 0 warnings

Please Help.



___
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] Npgsql

2005-06-06 Thread Elliott Draper
Well once you've got that sorted, if you need any more help with PgSQL, 
or anything else, post some information on the problem you are having 
here and I will take another look for you. Especially where SQL is 
concerned, if the error is being a bit on the vague side, then include 
your SQL statements, and code to create the connection/execute the 
statements, as this will greatly help anyone looking at it to get a 
grasp on what's going on.


Regards,
-= El =-

Carl Olsen wrote:


Actually, I tried a remote connection using putty and it timed out.  That
gave me a clue that it's Apache or Linux and not necessary the Npgsql.dll
file giving me a problem.  I've started to add several assemblies to the web
site and referenced them from the global.aspx.cs file, which means it can't
find some of the pieces.  That could easily be the problem.  I rebooted the
server and now the entire web site is broken.  I'll have to finish what I'm
doing and then check it again.

Thank you!

Carl

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Elliott Draper
Sent: Monday, June 06, 2005 6:19 AM
To: [EMAIL PROTECTED]
Cc: mono-list@lists.ximian.com
Subject: Re: [Mono-list] Npgsql

Well that sounds like the SQL call you are making is taking an 
exceedingly long time. Have you tried running the same call using psql 
from the command line, or from within the PgAdmin3 GUI to see how long 
the SQL actually takes to execute? You can increase the timeout on your 
connection object within your code, but that's really just avoiding the 
problem. What exactly is your code doing? Can you post a snippet of both 
the SQL you are using, and the code that creates the connection object 
and executes your SQL? I might be able to shed a bit more light on the 
issue then.


Regards,
-= El =-

Carl Olsen wrote:

 


I've increased the connections from 100 to 500 and increased some of the
settings in the memory section of the postgresql.conf file.  Now I'm
constantly getting this error:

Server error in '/' application

---
   


-
 




The request timed out.
Description: Error processing request. 
Error Message: HTTP 500. The request timed out. 



---
   


-
 




Any ideas?

Carl
http://www.carl-olsen.com/

-Original Message-
From: Elliott Draper [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 02, 2005 8:13 PM

To: [EMAIL PROTECTED]
Cc: mono-list@lists.ximian.com; mono-list@lists.ximian.com
Subject: Re: [Mono-list] Npgsql

The error that you're getting is coming straight back from the PgSQL
database. You need to free up some connections, and probably increase the
maximum number of connections at the server end to stop it happening again.
You could also use connection pooling in your app to try and limit the
amount of connections to the PgSQL database. However this error is simply
PgSQL saying its hit its client limit.

Regards,
-= El =-

-Original Message-
From: Carl Olsen [EMAIL PROTECTED]
To: mono-list@lists.ximian.com
Date: Thu, 2 Jun 2005 18:21:58 -0500
Subject: [Mono-list] Npgsql

Server error in '/' application

I keep getting this error until I refresh the page a few times.  Does
   


anyone
 


know what could be causing it?

Carl Olsen
http://www.carl-olsen.com/Legislators/Senators.aspx


---
   


-
 




Description: Error processing request. 
Error Message: HTTP 500. 


Stack Trace: Npgsql.NpgsqlException:
sorry, too many clients already
Severity: FATAL
Code: 53300
in 0x00056 Npgsql.NpgsqlConnector:CheckErrors ()
in 0x001e1 Npgsql.NpgsqlConnector:Open ()
in 0x00349 Npgsql.NpgsqlConnectorPool:GetPooledConnector
(Npgsql.NpgsqlConnection Connection)
in 0x00028 Npgsql.NpgsqlConnectorPool:RequestPooledConnectorInternal
(Npgsql.NpgsqlConnection Connection)
in 0x0005c Npgsql.NpgsqlConnectorPool:RequestPooledConnector
(Npgsql.NpgsqlConnection Connection)
in 0x00023 Npgsql.NpgsqlConnectorPool:RequestConnector
(Npgsql.NpgsqlConnection Connection)
in 0x00071 Npgsql.NpgsqlConnection:Open ()
in (wrapper remoting-invoke-with-check) Npgsql.NpgsqlConnection:Open ()
in 0x000d0 CarlsWebs.CarlOlsen.Web.Legislators.Senators:Page_Load
(System.Object sender, System.EventArgs e)
in (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)
in 0x00056 System.Web.UI.Control:OnLoad (System.EventArgs e)
in 0x00026 System.Web.UI.Control:LoadRecursive ()
in 0x00149 System.Web.UI.Page:InternalProcessRequest ()
in 0x000a9 System.Web.UI.Page:ProcessRequest (System.Web.HttpContext
context)
in 0x00233 System.Web.HttpApplication+ExecuteHandlerState:Execute ()
in 0x0007c System.Web.HttpApplication+StateMachine:ExecuteState
(IStateHandler state, System.Boolean readysync

Re: [Mono-list] Npgsql

2005-06-02 Thread Elliott Draper
The error that you're getting is coming straight back from the PgSQL database. 
You need to free up some connections, and probably increase the maximum number 
of connections at the server end to stop it happening again. You could also use 
connection pooling in your app to try and limit the amount of connections to 
the PgSQL database. However this error is simply PgSQL saying its hit its 
client limit.

Regards,
-= El =-

-Original Message-
From: Carl Olsen [EMAIL PROTECTED]
To: mono-list@lists.ximian.com
Date: Thu, 2 Jun 2005 18:21:58 -0500
Subject: [Mono-list] Npgsql

Server error in '/' application

I keep getting this error until I refresh the page a few times.  Does anyone
know what could be causing it?

Carl Olsen
http://www.carl-olsen.com/Legislators/Senators.aspx





Description: Error processing request. 
Error Message: HTTP 500. 

Stack Trace: Npgsql.NpgsqlException:
sorry, too many clients already
Severity: FATAL
Code: 53300
in 0x00056 Npgsql.NpgsqlConnector:CheckErrors ()
in 0x001e1 Npgsql.NpgsqlConnector:Open ()
in 0x00349 Npgsql.NpgsqlConnectorPool:GetPooledConnector
(Npgsql.NpgsqlConnection Connection)
in 0x00028 Npgsql.NpgsqlConnectorPool:RequestPooledConnectorInternal
(Npgsql.NpgsqlConnection Connection)
in 0x0005c Npgsql.NpgsqlConnectorPool:RequestPooledConnector
(Npgsql.NpgsqlConnection Connection)
in 0x00023 Npgsql.NpgsqlConnectorPool:RequestConnector
(Npgsql.NpgsqlConnection Connection)
in 0x00071 Npgsql.NpgsqlConnection:Open ()
in (wrapper remoting-invoke-with-check) Npgsql.NpgsqlConnection:Open ()
in 0x000d0 CarlsWebs.CarlOlsen.Web.Legislators.Senators:Page_Load
(System.Object sender, System.EventArgs e)
in (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)
in 0x00056 System.Web.UI.Control:OnLoad (System.EventArgs e)
in 0x00026 System.Web.UI.Control:LoadRecursive ()
in 0x00149 System.Web.UI.Page:InternalProcessRequest ()
in 0x000a9 System.Web.UI.Page:ProcessRequest (System.Web.HttpContext
context)
in 0x00233 System.Web.HttpApplication+ExecuteHandlerState:Execute ()
in 0x0007c System.Web.HttpApplication+StateMachine:ExecuteState
(IStateHandler state, System.Boolean readysync)
 







___
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


[Mono-list] DNFS v1.0.0 beta

2005-06-02 Thread Elliott Draper
Hi everyone,

I have released the first (beta) version of DNFS, a simple command line utility 
that acts as an object browser for .Net/Mono assemblies.

It is available from:
http://www.ejdraper.org.uk/dnfs

It is lightheartedly called DotNetFileSystem, because you simply run the app 
against an assembly, and you get a simple shell, allowing you to use familiar 
commands such as ls, dir and cd to browse the assembly. You can navigate 
through namespaces, classes, down to method level accurately at the minute. 
It's a useful tool where a full blown GUI object browser isn't an option, and 
where simplicity, speed of use is key :-) I do have a few plans for 
improvements/additions, but largely the simplicity will always remain as that 
is really the main point of this tool.

Any comments, suggestions, contributions will be welcomed,

Cheers,
-= El =-

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