[Mono-winforms-list] GUI desginer for winforms ?
Hi all, is there a project to create a GUI desginer for winforms running under mono/linux ? maybe linked to monodevelop regards, alex ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Re: [Mono-dev] latest mono completely broken for ASP.NET on Suse as far as I can tell
Thanks Gonzalo! Dean Brettle also suggested I try launching it with just xsp from the command line to see if it gives any more error info. I will try that after I get home from work as well. I'm using the same configuration for apache that I have been using all along and was wondering whether anything needs to be configured differently for the latest code. Gonzalo Paniagua Javier [EMAIL PROTECTED] wrote: On Thu, 2005-11-10 at 20:49 -0800, Joe Audette wrote: I posted a message earlier this week about getting a 503 service unavailable on my demo site demo.mojoportal.com running the latest code from svn (also updated tonight to r52890 with same result) and no-one replied to my post. this is on suse 9.2 Now I've tried a clean install of Suse 10 with the latest mono 1.1.10 on a different machine and the same result 503 service unavailable What gives! Is anyone out there running the latest code with success on suse?I am on suse 10.I'll try installing from packages and see what's wrong with mod_mono/xspin the next few hours.-Gonzalo___Mono-devel-list mailing listMono-devel-list@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-devel-listjoe_audette [at] yahoo dotcomhttp://www.joeaudette.comhttp://www.mojoportal.com___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] ASP 2 CodeFile/Inherits
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I had a little bug open on the codefile stuff not working properly. The SVN patch didn't quite handle all the conditions, so I reopened the ticket at: http://bugzilla.ximian.com/show_bug.cgi?id=76423 I also went through and created a patch for the code that should handle all the cases that I found from my research on the web. It is a little more involved, mainly because of ASP 2's use of partial classes and the need to use variables from the ending classes. I wrote it off today's SVN, so things should be fairly up-to-date. Also, to test it, I created a small web application that has the three forms of codefile/inherits and posted it in a zip file on the bug. Feedback, suggestions, and gouged out eyeballs from reading the horror of my code all appreciated. :) Cheers! -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.2 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFDdOzZLwDfJiZIuKARAmlqAJ9wtLJuFbJUlZfnj+wU6teXKGjxbACfftx2 CZILDeXmqA8MdFbQhno6sf0= =13NX -END PGP SIGNATURE- Index: System.Web.UI/ControlBuilder.cs === --- System.Web.UI/ControlBuilder.cs (revision 52911) +++ System.Web.UI/ControlBuilder.cs (working copy) @@ -497,6 +497,19 @@ { return CreateInstance (); } + + internal void ResetState() + { + haveParserVariable = false; + + if (Children != null) { +foreach (object child in Children) { + ControlBuilder cb = child as ControlBuilder; + if (cb != null) + cb.ResetState (); +} + } + } #endif } } Index: System.Web.UI/TemplateParser.cs === --- System.Web.UI/TemplateParser.cs (revision 52911) +++ System.Web.UI/TemplateParser.cs (working copy) @@ -67,6 +67,10 @@ string oc_header, oc_custom, oc_param, oc_controls; bool oc_shared; OutputCacheLocation oc_location; +#if NET_2_0 + string src; + string partialClassName; +#endif Assembly srcAssembly; int appAssemblyIndex = -1; @@ -421,21 +425,48 @@ language = GetString (atts, Language, CompilationConfig.DefaultLanguage); strictOn = GetBool (atts, Strict, CompilationConfig.Strict); explicitOn = GetBool (atts, Explicit, CompilationConfig.Explicit); + + string inherits = GetString (atts, Inherits, null); #if NET_2_0 - string src = GetString (atts, CodeFile, null); + // In ASP 2, the source file is actually integrated with + // the generated file via the use of partial classes. This + // means that the code file has to be confirmed, but not + // used at this point. + src = GetString (atts, CodeFile, null); + + if (src != null inherits != null) { +// Make sure the source exists +src = UrlUtils.Combine (BaseVirtualDir, src); +string realPath = MapPath (src, false); +if (!File.Exists (realPath)) + ThrowParseException (File + src + not found); + +// Verify that the inherits is a valid identify not a +// fully-qualified name. +if (!CodeGenerator.IsValidLanguageIndependentIdentifier (inherits)) + ThrowParseException (String.Format ('{0}' is not valid for 'inherits', inherits)); + +// We are going to create a partial class that shares +// the same name as the inherits tag, so reset the +// name. The base type is changed because it is the +// code file's responsibilty to extend the classes +// needed. +partialClassName = inherits; + +// Add the code file as an option to the +// compiler. This lets both files be compiled at once. +compilerOptions += + realPath; + } else if (inherits != null) { +// We just set the inherits directly because this is a +// Single-Page model. +SetBaseType (inherits); + } #else string src = GetString (atts, Src, null); -#endif + if (src != null) srcAssembly = GetAssemblyFromSource (src); - string inherits = GetString (atts, Inherits, null); -#if NET_2_0 - if (srcAssembly == null) -className = inherits; - else -SetBaseType (inherits); -#else if (inherits != null) SetBaseType (inherits); @@ -498,6 +529,18 @@ set { inputFile = value; } } +#if NET_2_0 + internal bool IsPartial + { + get { return src != null; } + } + + internal string PartialClassName + { + get { return partialClassName; } + } +#endif + internal string Text { get { return text; } Index: System.Web.Compilation/CachingCompiler.cs === --- System.Web.Compilation/CachingCompiler.cs (revision 52915) +++ System.Web.Compilation/CachingCompiler.cs (working copy) @@ -70,11 +70,18 @@ Cache cache = HttpRuntime.Cache; string key = cachePrefix + compiler.Parser.InputFile; CompilerResults results = (CompilerResults) cache [key]; + +#if NET_2_0 + if (!compiler.IsRebuildingPartial) +#endif if (results != null) return results;
Re: [Mono-dev] latest mono completely broken for ASP.NET on Suse as far as I can tell
On Fri, 2005-11-11 at 09:32 -0800, Joe Audette wrote: Thanks Gonzalo! Dean Brettle also suggested I try launching it with just xsp from the command line to see if it gives any more error info. I will try that after I get home from work as well. I'm using the same configuration for apache that I have been using all along and was wondering whether anything needs to be configured differently for the latest code. The problem is now fixed in mod_mono module for svn HEAD and 1-1-10 branch. We hope to have new packages out soon. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] MonoDevelop crashes under Mono 1.1.10 on FC3
Hi all, Yesterday MonoDevelop was working fine. Last night, I upgraded my FC3 system from 1.1.9.2 to 1.1.10. Now MonoDevelop crashes on startup. See below for stacktrace. In case it matters, I'm running the x86_64 variant of FC3, but I use the i386 Mono RPMS (for both versions). Has anyone else seen this problem or had success with 1.1.10 on FC3 or FC4 (either i386 or x86_64)? Thanks, --Dean [EMAIL PROTECTED] monodevelop]$ monodevelop = Got a SIGSEGV while executing native code. This usually indicates a fatal error in the mono runtime or one of the native libraries used by your application. = Stacktrace: in 0x4 (wrapper managed-to-native) Gnome.Icon:gnome_icon_lookup_sync (intptr,intptr,intptr,intptr,int,int) in 0xffba (wrapper managed-to-native) Gnome.Icon:gnome_icon_lookup_sync (intptr,intptr,intptr,intptr,int,int) in 0x92 Gnome.Icon:LookupSync (Gtk.IconTheme,Gnome.ThumbnailFactory,string,string,Gnome.IconLookupFlags,Gnome.IconLookupResultFlags) in 0x6e MonoDevelop.Gui.Utils.FileIconLoader:GetPixbufForFile (string,int) in 0xf6 MonoDevelop.Gui.Pads.FileListItem:.ctor (string) in 0xfe MonoDevelop.Gui.Pads.FileScout:OnDirChanged (string) in 0x2a9 MonoDevelop.Gui.Pads.FileScout:.ctor () in 0x111e85a7 (wrapper runtime-invoke) System.Object:runtime_invoke_void (object,intptr,intptr,intptr) in 0x4 (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) in 0xfd7d (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) in 0x8d System.Reflection.MonoCMethod:Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) in 0x1c System.Reflection.MonoCMethod:Invoke (System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) in 0x35 System.Reflection.ConstructorInfo:Invoke (object[]) in 0x116 System.Activator:CreateInstance (System.Type,bool) in 0xc System.Activator:CreateInstance (System.Type) in 0x3a System.Reflection.Assembly:CreateInstance (string,bool) in 0x12 System.Reflection.Assembly:CreateInstance (string) in 0xc2 MonoDevelop.Core.AddIns.AddIn:CreateObject (string) in 0x83 MonoDevelop.Core.AddIns.Codons.PadCodon:CreatePad () in 0x14 MonoDevelop.Core.AddIns.Codons.PadCodon:BuildItem (object,System.Collections.ArrayList,MonoDevelop.Core.AddIns.Conditions.ConditionCollection) in 0x13b MonoDevelop.Core.AddIns.DefaultAddInTreeNode:BuildChildItems (object)in 0x5b MonoDevelop.Gui.DefaultWorkbench:UpdateViews (object,System.EventArgs)in 0x38 MonoDevelop.Commands.InitializeWorkbenchCommand:Run () in 0x8b4 MonoDevelop.SharpDevelopMain:Main (string[]) in 0x10aceb4f (wrapper runtime-invoke) System.Object:runtime_invoke_int_string[] (object,intptr,intptr,intptr) Native stacktrace: /usr/bin/mono(mono_handle_native_sigsegv+0xba) [0x81471da] /usr/bin/mono [0x81354cf] [0xe600] /usr/lib/libgnomeui-2.so.0(gnome_icon_lookup_sync+0x70) [0x78996ee] [0xf5e901aa] [0xf5e9012b] [0xf5e8fd87] [0xf6677437] [0xf66771a7] [0xf5e8b412] [0xf6f4ce01] /usr/bin/mono [0x8135380] /usr/bin/mono(mono_runtime_invoke+0x27) [0x80d42b7] /usr/bin/mono(mono_runtime_invoke_array+0xe1) [0x80d5361] /usr/bin/mono [0x80c3e00] [0xf70a6ec2] [0xf70a6c16] [0xf70a6b7d] [0xf70a6b36] [0xf70866cf] [0xf6f4cdad] [0xf6ef2abb] [0xf6ef90f3] [0xf6ef8e43] [0xf5e8ad6c] [0xf5e8acd5] [0xf6ef76c4] [0xf5e8abdc] [0xf5e947f1] [0xf7667a95] [0xf766685c] /usr/bin/mono [0x8135380] /usr/bin/mono(mono_runtime_invoke+0x27) [0x80d42b7] /usr/bin/mono(mono_runtime_exec_main+0xb1) [0x80d5191] /usr/bin/mono(mono_runtime_run_main+0x171) [0x80d4d61] /usr/bin/mono(strftime+0x1b52) [0x805cb72] /usr/bin/mono(mono_main+0x785) [0x805d485] /usr/bin/mono(__fxstat64+0x12b) [0x805bf3b] /lib/tls/libc.so.6(__libc_start_main+0xd3) [0x794e23] /usr/bin/mono(sinh+0x41) [0x805be91] ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] latest mono completely broken for ASP.NET on Suse as far as I can tell
Great! I'll give it a try this evening on my suse 9.2 machine and try and confirm the fix.Gonzalo Paniagua Javier [EMAIL PROTECTED] wrote: On Fri, 2005-11-11 at 09:32 -0800, Joe Audette wrote: Thanks Gonzalo! Dean Brettle also suggested I try launching it with just xsp from the command line to see if it gives any more error info. I will try that after I get home from work as well. I'm using the same configuration for apache that I have been using all along and was wondering whether anything needs to be configured differently for the latest code.The problem is now fixed in mod_mono module for svn HEAD and 1-1-10branch. We hope to have new packages out soon.-Gonzalo___Mono-devel-list mailing listMono-devel-list@lists.ximian.comhttp://lists.ximian.com/mailman/listinfo/mono-devel-listjoe_audette [at] yahoo dotcomhttp://www.joeaudette.comhttp://www.mojoportal.com___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Mono 1.1.10 Issues with XSP and Radio Button.
On Fri, 2005-11-11 at 18:10 -0500, Yogendra Thakur wrote: Hi, I am running Mono 1.1.10 on Fedora Core 3 machine. I observed following issues, 1. Following message is thrown lot of time on Screen while accessing web application.. ** (/opt/mono-1.1.10/lib/xsp/1.0/xsp.exe:11150): WARNING **: _wapi_handle_unref: Attempting to unref unused handle 0x44. This has nothing to do with xsp. Do you have other versions of mono running in the same machine by the same user? Anyway, removing $HOME/.wapi directory should fix that. 2. I have two radio buttons on page, when clicked both gets selected ! ( see attachment ). Could you please fill a bug report in bugzilla.ximian.com (see http://www.mono-project.com/Bugs) ? Sending all this information to the list is ok, but if you put all this information in bugzilla, i won't forget about it. 3. When browse application randomly and with fast speed sometimes XSP server crashes with following message. *** glibc detected *** double free or corruption: 0xf6fe55d0 *** If you have a way of relibly reproducing this, please, let me know. Thanks. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] latest mono completely broken for ASP.NET on Suse as far as I can tell
Yes! I confirm it is fixed in svn r52934 http://demo.mojoportal.com is back online Many Thanks Gonzalo! --- Gonzalo Paniagua Javier [EMAIL PROTECTED] wrote: On Fri, 2005-11-11 at 09:32 -0800, Joe Audette wrote: Thanks Gonzalo! Dean Brettle also suggested I try launching it with just xsp from the command line to see if it gives any more error info. I will try that after I get home from work as well. I'm using the same configuration for apache that I have been using all along and was wondering whether anything needs to be configured differently for the latest code. The problem is now fixed in mod_mono module for svn HEAD and 1-1-10 branch. We hope to have new packages out soon. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list 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
AW: [Mono-list] To compile with mono mbas
Hi Valentina, In Form.aspx, there should be a directive like %@ Page Language=VB Src=Form.aspx.vb Inherits=MyNamespace.MyClassName.Form % Please pay attention to the difference between Codebehind= and Src=; the first one is a hint for Visual Studio only, the second leads to a real JIT compilation of Form.aspx.vb. -Jochen -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [EMAIL PROTECTED] Gesendet: Donnerstag, 10. November 2005 20:37 An: Mono mainling-list Betreff: [Mono-list] To compile with mono mbas Hi, Sorry for the stupid question but I'm new in mono/mbas. I have Form.aspx and Form.aspx.vb files with the imports System.Windows.Forms, System.Data and MySql.Data.MySqlClient What I have to do to compile? Thank's to all, Valentina. ___ 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] Scripting the Linux OS with Mono
I havent tried this but... http://www.codeproject.com/csharp/cs-script_for_CP.asp I have seen another project but I cant find it at the moment. ___ Yahoo! Model Search 2005 - Find the next catwalk superstars - http://uk.news.yahoo.com/hot/model-search/ ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Scripting the Linux OS with Mono
I did something similar; however, my cs file was already compiled into a dll. I then created an exe that would take command line arguments, the args were the name of the dll to load and, the method to execute, and the parameters it expected. All of this was done using Refelection. I didnt do it for start up scripts or anything I did it as an integration suite with third party vendors who needed their data in a format that was different from mine. Once I had the Integration Bus written(exe) whenever the bossman came in and asked if we could send over data to someone else using package X it was only a matter of making X.dll and setting it up to be loaded by the Integration Bus in cron (or a job in sql server, or...) with its respective arguments. mono IntegrationBus.exe -t dlls/X.dll -m SomeClass -props startDate='10/01/2005',endDate='10/31/2005',propertyID=10 -meth SomeMethod Reflection is cool. Regards, Shawn Vose ted leslie wrote: I too find it appealling to use C# in place of perl, etc. I am not sure what your asking can happen with the mono distro. you could however, if you don't want to just have my_script.cs my_script.exe as a "pair" and use the exe to execute your script, that goes without saying. i guess you could make a shell script that woud say monoscript my_script.cs arg1 arg2 that would compile it to a temporary file /tmp/csexe_uniqueid.exe (in tmp?) and run the exe with the args essentially giving you what you want and removing the tmp exe when done ? no different then perl my_script.pl arg1 arg2 just that "monoscript" is this shell beast you write, which would be a few lines. except you would have to know how to "make" your exe based on whats in the *.cs file and not what would be in a Makefile, for its libraries ? i would personally love to see more movement in this area .. i.e. mono/C# as a linux/unix scripting language! maybe in the end it just needs to be formalized by someone at mono? -tl On Thu, 10 Nov 2005 19:02:49 -0500 Abe Gillespie [EMAIL PROTECTED] wrote: Hey all, I was wondering if there's any easy way to run C# scripts in Mono. I'm fairly new to Linux (just at about a year) and I'd like to avoid learning yet another language (Perl, sh, etc.). Has anyone written a .Net program that takes a file as input and runs that code? Perhaps Mono can do this natively? How cool would it be to have startup scripts written in C#?! Thanks for the help as always. -Abe ___ 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 maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Web service returning DataSet
Ivano Luberti wrote: Thanks Oleg, when it will be released ? Maybe I have lost some messages: how endend up this request by Oleg ? Here is reply from Lluis Sanchez: http://permalink.gmane.org/gmane.comp.gnome.mono.general/24519 And I'm waiting for the next release. Today I've tested mono 1.1.10 - and it works nice. Thanks to developers! -- Oleg smime.p7s Description: S/MIME Cryptographic Signature ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Web service returning DataSet
Thank to you for the news ! At 16.45 11/11/2005, Oleg Deribas wrote: Ivano Luberti wrote: Thanks Oleg, when it will be released ? Maybe I have lost some messages: how endend up this request by Oleg ? Here is reply from Lluis Sanchez: http://permalink.gmane.org/gmane.comp.gnome.mono.general/24519 And I'm waiting for the next release. Today I've tested mono 1.1.10 - and it works nice. Thanks to developers! -- Oleg ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list == Archimede Informatica NEWS! == Realizzato il Sistema Integrato per la biglietteria della Torre di Pisa: prenotazione, vendita, pre-vendita ed emissione dei biglietti di ingresso alla Torre sia online che presso le biglietterie dislocate sulla piazza: http://www.opapisa.it/boxoffice Partner del Progetto Ci-Tel Front office Telematico per il cittadino Ente Coordinatore Comune di Pisa http://www.comune.pisa.it/doc/e-government.htm == dott. Ivano Mario Luberti Archimede Informatica societa' cooperativa a r. l. Sede Operativa Via Gereschi 36 - 56126- Pisa tel.: +39-050- 580959 tel/fax: +39-050-9711344 e-mail: [EMAIL PROTECTED] web: http://www.archicoop.it ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Release 1.1.10 for Windows?
I see that release 1.1.10 is out. Will there be an installer for Windows? Im assuming that this is just lagging by a day or two. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Scripting the Linux OS with Mono
Hi Abe, Abe Gillespie wrote: *snip mono script_host.exe MyScript.cs myarg1 myarg2 *snip Has anyone out there done something or started a project like this? Give the attached source code a try :-) I'm not claiming it's perfect, but it's something I knocked up while I was bored this afternoon, and you may be able to use it or tweak it to what you need. It uses the features of CodeDom, available both in .Net and Mono, to compile the source file to an in-memory assembly, where the code can then be executed. The file MonoScript.cs can be compiled on its own to provide the actual script execution tool, and also attached is a sample script file (Test.cs) that you can use to give it a bash. Simply compile the MonoScript tool: mcs MonoScript.cs And then it's as easy as running: mono MonoScript.exe --sourceFile:Test.cs If for example your source file has a reference to System.Data then you can simply run: mono MonoScript.exe --sourceFile:Test.cs --references:System.Data.dll For the full usage of the program, run: mono MonoScript.exe --displayUsage:true Any arguments you specify that MonoScript doesn't recognize will be forwarded onto the script application, you can see this by appending as many arguments as you want to the test script: mono MonoScript.exe --sourceFile:Test.cs test1 test2 test3 Have a play, and give me a shout if you run into any bugs or problems with it and I'll do my best to fix them, failing that, jump right in and tweak the code yourself ;-) If anyone else finds the code useful, let me know and I'll get the entire thing (project files, a build file maybe, a bigger testsuite perhaps?) up on my website as a package. Likewise if anyone has any comments, let me have 'em! -Abe Cheers, -= El =- On 11/10/05, Kornél Pál [EMAIL PROTECTED] wrote: Hi, You have to compile C# code using mcs that will result in a .exe assembly that can be executed using mono: $mcs some.cs $mono some.exe If you prefer you can write a shell script that will do this as a single step. Kornél - Original Message - From: Abe Gillespie [EMAIL PROTECTED] To: MonoList mono-list@lists.ximian.com Sent: Friday, November 11, 2005 1:02 AM Subject: [Mono-list] Scripting the Linux OS with Mono Hey all, I was wondering if there's any easy way to run C# scripts in Mono. I'm fairly new to Linux (just at about a year) and I'd like to avoid learning yet another language (Perl, sh, etc.). Has anyone written a .Net program that takes a file as input and runs that code? Perhaps Mono can do this natively? How cool would it be to have startup scripts written in C#?! Thanks for the help as always. -Abe ___ 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 using System; public class MonoScriptTest { //This simply displays the amount of arguments passed into it public static void Main(string[] args) { Console.WriteLine(string.Format(MonoScript: test script, {0} arguments,args.Length.ToString())); } }using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections.Specialized; using System.Reflection; namespace MonoScript { /// summary /// This allows the execution of a .cs file as if it were a program, compiling it on the fly then executing it /// /// Example syntax: /// /// MonoScript /s:myscript.cs /r:System.Drawing.dll This would execute the code within the /// file myscript.cs, and reference System.Drawing.dll when compiling it /// /// MonoScript /s:myscript.cs /r:System.Data.dll /n:true /v:trueThis would compile the code within the /// file myscript.cs, reference System.Data.dll when doing it, stop the MonoScript logo from displaying /// when run, and also ensure that ONLY compilation takes place, not execution, for validation purposes /// /summary class MonoScript { /// summary /// These are our options for the script to execute /// /summary static MonoScriptOptions Options; /// summary /// Main entry point /// /summary /// param name=args/param static void Main(string[] args) { //Create our options from the command line args Options = new MonoScriptOptions(args); //Only show the logo if we haven't been told not to if(!Options.NoLogo) Logo(); //If the user has requested the program usage, then show it here if (Options.DisplayUsage) { Usage(); return; } //This will hold our in-memory compiled assembly Assembly assembly =
Re: [Mono-list] Scripting the Linux OS with Mono
On Fri, 11 Nov 2005 19:34:51 + Elliott Draper [EMAIL PROTECTED] wrote: Hi Abe, Abe Gillespie wrote: *snip mono script_host.exe MyScript.cs myarg1 myarg2 *snip Has anyone out there done something or started a project like this? Give the attached source code a try :-) I'm not claiming it's perfect, but it's something I knocked up while I was bored this afternoon, and you may be able to use it or tweak it to what you need. It uses the features of CodeDom, available both in .Net and Mono, to compile the source file to an in-memory assembly, where the code can then be executed. The file MonoScript.cs can be compiled on its own to provide the actual script execution tool, and also attached is a sample script file (Test.cs) that you can use to give it a bash. Simply compile the MonoScript tool: mcs MonoScript.cs And then it's as easy as running: mono MonoScript.exe --sourceFile:Test.cs If for example your source file has a reference to System.Data then you can simply run: you could parse for the popular ones and illiminate this step right? mono MonoScript.exe --sourceFile:Test.cs --references:System.Data.dll For the full usage of the program, run: mono MonoScript.exe --displayUsage:true Any arguments you specify that MonoScript doesn't recognize will be forwarded onto the script application, you can see this by appending as many arguments as you want to the test script: mono MonoScript.exe --sourceFile:Test.cs test1 test2 test3 Have a play, and give me a shout if you run into any bugs or problems with it and I'll do my best to fix them, failing that, jump right in and tweak the code yourself ;-) If anyone else finds the code useful, let me know and I'll get the entire thing (project files, a build file maybe, a bigger testsuite perhaps?) up on my website as a package. Likewise if anyone has any comments, let me have 'em! -Abe Cheers, -= El =- On 11/10/05, Kornél Pál [EMAIL PROTECTED] wrote: Hi, You have to compile C# code using mcs that will result in a .exe assembly that can be executed using mono: $mcs some.cs $mono some.exe If you prefer you can write a shell script that will do this as a single step. Kornél - Original Message - From: Abe Gillespie [EMAIL PROTECTED] To: MonoList mono-list@lists.ximian.com Sent: Friday, November 11, 2005 1:02 AM Subject: [Mono-list] Scripting the Linux OS with Mono Hey all, I was wondering if there's any easy way to run C# scripts in Mono. I'm fairly new to Linux (just at about a year) and I'd like to avoid learning yet another language (Perl, sh, etc.). Has anyone written a .Net program that takes a file as input and runs that code? Perhaps Mono can do this natively? How cool would it be to have startup scripts written in C#?! Thanks for the help as always. -Abe ___ 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 maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Scripting the Linux OS with Mono
Dude, you totally rock! I'll be giving this a try this weekend. -Abe On 11/11/05, Elliott Draper [EMAIL PROTECTED] wrote: Hi Abe, Abe Gillespie wrote: *snip mono script_host.exe MyScript.cs myarg1 myarg2 *snip Has anyone out there done something or started a project like this? Give the attached source code a try :-) I'm not claiming it's perfect, but it's something I knocked up while I was bored this afternoon, and you may be able to use it or tweak it to what you need. It uses the features of CodeDom, available both in .Net and Mono, to compile the source file to an in-memory assembly, where the code can then be executed. The file MonoScript.cs can be compiled on its own to provide the actual script execution tool, and also attached is a sample script file (Test.cs) that you can use to give it a bash. Simply compile the MonoScript tool: mcs MonoScript.cs And then it's as easy as running: mono MonoScript.exe --sourceFile:Test.cs If for example your source file has a reference to System.Data then you can simply run: mono MonoScript.exe --sourceFile:Test.cs --references:System.Data.dll For the full usage of the program, run: mono MonoScript.exe --displayUsage:true Any arguments you specify that MonoScript doesn't recognize will be forwarded onto the script application, you can see this by appending as many arguments as you want to the test script: mono MonoScript.exe --sourceFile:Test.cs test1 test2 test3 Have a play, and give me a shout if you run into any bugs or problems with it and I'll do my best to fix them, failing that, jump right in and tweak the code yourself ;-) If anyone else finds the code useful, let me know and I'll get the entire thing (project files, a build file maybe, a bigger testsuite perhaps?) up on my website as a package. Likewise if anyone has any comments, let me have 'em! -Abe Cheers, -= El =- On 11/10/05, Kornél Pál [EMAIL PROTECTED] wrote: Hi, You have to compile C# code using mcs that will result in a .exe assembly that can be executed using mono: $mcs some.cs $mono some.exe If you prefer you can write a shell script that will do this as a single step. Kornél - Original Message - From: Abe Gillespie [EMAIL PROTECTED] To: MonoList mono-list@lists.ximian.com Sent: Friday, November 11, 2005 1:02 AM Subject: [Mono-list] Scripting the Linux OS with Mono Hey all, I was wondering if there's any easy way to run C# scripts in Mono. I'm fairly new to Linux (just at about a year) and I'd like to avoid learning yet another language (Perl, sh, etc.). Has anyone written a .Net program that takes a file as input and runs that code? Perhaps Mono can do this natively? How cool would it be to have startup scripts written in C#?! Thanks for the help as always. -Abe ___ 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 using System; public class MonoScriptTest { //This simply displays the amount of arguments passed into it public static void Main(string[] args) { Console.WriteLine(string.Format(MonoScript: test script, {0} arguments,args.Length.ToString())); } } using System; using System.CodeDom; using System.CodeDom.Compiler; using System.Collections.Specialized; using System.Reflection; namespace MonoScript { /// summary /// This allows the execution of a .cs file as if it were a program, compiling it on the fly then executing it /// /// Example syntax: /// /// MonoScript /s:myscript.cs /r:System.Drawing.dll This would execute the code within the /// file myscript.cs, and reference System.Drawing.dll when compiling it /// /// MonoScript /s:myscript.cs /r:System.Data.dll /n:true /v:trueThis would compile the code within the /// file myscript.cs, reference System.Data.dll when doing it, stop the MonoScript logo from displaying /// when run, and also ensure that ONLY compilation takes place, not execution, for validation purposes /// /summary class MonoScript { /// summary /// These are our options for the script to execute /// /summary static MonoScriptOptions Options; /// summary /// Main entry point /// /summary /// param name=args/param static void Main(string[] args) { //Create our options from the command line args Options = new MonoScriptOptions(args); //Only show the logo if we haven't been told not to if(!Options.NoLogo) Logo(); //If the user has requested the program
[Mono-list] Error when loading monodevelop
I've posted this to both the mono and monodevelop lists. I have just unistalled all the previous mono stuff, and attempted to get monodevelop running using the new mono-1.1.10_0-installer.bin. I get the following error when I attempt to start monodevelop. Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for Gnome.ModuleInfo --- System.DllNotFoundException: gnomesharpglue-2 in (wrapper managed-to-native) Gnome.ModuleInfo:gnomesharp_gnome_moduleinfo_get_ name_offset () in 0x8 Gnome.ModuleInfo:.cctor ()--- End of inner exception stack trace --- in 0x0 unknown method in 0x00025 Gnome.Modules:get_UI () in 0x00443 MonoDevelop.SharpDevelopMain:Main (System.String[] args) I'm using Madriva Linux 2006 with the 2.6.16 kernel = 2.6.12-12mdk Regards Tracy Barlow ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Error when loading monodevelop
I now have monodevelop working using the mono-1.1.9.2_2-installer.bin the missing gnomesharpglue-2 error does not occur in the older version. Regards Tracy Barlow ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list