[Mono-list] Hackers with Windows boxes + Perl needed
Hi, I was wondering if anyone on this list had a Windows box + Mono + Perl that could try out my Perl interpreter bindings for C#[1]. Basically I wanted access to all the useful utilities out there on CPAN[2] that aren't yet available in managed code or in the standard class libraries. The distribution gives a sample IMAP client using Mail::IMAPClient. It works on Linux (Gentoo SuSE 9) and seems to work OK on OS X with a little munging of the library names and modulo mono-wierdness wrt exceptions (yes I know about mint...). I'd ideally like it to work on Windows as well, then it could be a truly cross-platform way of getting lots of functionality into C# for 'free'. I've based the build system on Gtk#. For those that just want to look at how easy it is to embed Perl using the powerful features of C# take a look at the IMAP example[3]. C# really does make this nice, a lot nicer than the Perl C API! For example Scalars are auto-boxed to the approriate fundamental types (int, double, string). [1] http://www.srcf.ucam.org/~rjw57/mono_files/ [2] http://search.cpan.org/ [3] http://charon.ucam.org/mason/highlight.html?file=IMAPExample.cs -- Rich ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Re: [ANN] Firebird ADO.NET Data Provider 1.5.2 released
FYI, the pdf documentation is still unreadable under Linux. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Re: [ANN] Firebird ADO.NET Data Provider 1.5.2 released
Hello: FYI, the pdf documentation is still unreadable under Linux. The PDF file is being generated from a latex file generated with NDoc ;) Try to read the javadoc format documentation ( HTML ) -- Best regards Carlos Guzmán Álvarez Vigo-Spain ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: monodevelop on osx - was: [Mono-list] SIGILL in I18N on OSX
This is due the the config file issue, I sent a patch to the dev list, but nobody replied to review it yet! - Urs On Mar 23, 2004, at 10:00 PM, Attila Balogh wrote: Erik Dasque wrote: Hmmm, Yes, I think I had this problem at some point. Set LD_LIBRARY_PATH since you're talking about .so libraries here. Renaming them to dylib won't help, they're not dylibs. So set LD_LIBRARY_PATH the same way you set DYLD_LIBRARY_PATH. Let me know if that fixes it. Erik At 08:14 PM 3/23/2004, Attila Balogh wrote: hello, still on running monodevelop on osx. I get a gtksharpglue dll not found exception. Those are in /usr/local/lib/libgtksharpglue.so, ... (I even renamed them to .dylib, and I tried a entry in the config, no change). at me the first problem is with libgnomeui.so this is the exact message: Unhandled Exception: System.DllNotFoundException: libgnomeui-2.so.0 #0: 0x00011 throw in Gnome.Modules::libgnomeui_module_info_get () #1: 0x0 call in Gnome.Modules::get_UI () #2: 0xa call in MonoDevelop.SharpDevelopMain::Main ([O:0xa5f78] ) Rob suggested to export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib, it didn't help either. (i edited /sw/etc/lib/mono/config, .so* - .dylib already) any ideas, Urs did you get further? Attila ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list tried it, didn't work, exactly the same message. Attila ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: monodevelop on osx - was: [Mono-list] SIGILL in I18N on OSX
did you install mono from fink? if so, you have to add /sw/lib to DYLD_LIBRARY_PATH instead of /usr/local/lib On Mar 23, 2004, at 10:00 PM, Attila Balogh wrote: Erik Dasque wrote: Hmmm, Yes, I think I had this problem at some point. Set LD_LIBRARY_PATH since you're talking about .so libraries here. Renaming them to dylib won't help, they're not dylibs. So set LD_LIBRARY_PATH the same way you set DYLD_LIBRARY_PATH. Let me know if that fixes it. Erik At 08:14 PM 3/23/2004, Attila Balogh wrote: hello, still on running monodevelop on osx. I get a gtksharpglue dll not found exception. Those are in /usr/local/lib/libgtksharpglue.so, ... (I even renamed them to .dylib, and I tried a entry in the config, no change). at me the first problem is with libgnomeui.so this is the exact message: Unhandled Exception: System.DllNotFoundException: libgnomeui-2.so.0 #0: 0x00011 throw in Gnome.Modules::libgnomeui_module_info_get () #1: 0x0 call in Gnome.Modules::get_UI () #2: 0xa call in MonoDevelop.SharpDevelopMain::Main ([O:0xa5f78] ) Rob suggested to export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib, it didn't help either. (i edited /sw/etc/lib/mono/config, .so* - .dylib already) any ideas, Urs did you get further? Attila ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list tried it, didn't work, exactly the same message. Attila ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] PerlSharp (was Hackers with Windows boxes + Perl needed)
Rich Wareham wrote: could try out my Perl interpreter bindings for C#[1]. Heh, cool. I started working on the same thing a few weeks ago... It's funny that we used a lot of the same naming conventions. I don't have a nice wrapper for Perl objects and I avoided array-context evals, but I do have hashes, code references, multiple interpreters, and the ability to call back into the managed world from Perl (which is a lot of fun). If anyone is interested: http://taubz.for.net/code/perlsharp-jt.tgz -- - Joshua Tauberer http://taubz.for.net ** Nothing Unreal Exists ** ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: monodevelop on osx - was: [Mono-list] SIGILL in I18N on OSX
Urs C Muff wrote: did you install mono from fink? if so, you have to add /sw/lib to DYLD_LIBRARY_PATH instead of /usr/local/lib On Mar 23, 2004, at 10:00 PM, Attila Balogh wrote: Yes, and i added /sw/lib in the first place. Could i check the patch you created? Regards Attila ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] SIGILL in I18N on OSX
Did you ever get this fixed? If you didn't, the problem is that at this phase of the buld the makefiles are using the internal mcs (the one it just built). In order to do this, it calls it directly instead of using the mcs script: ---(snip!)--- Creating ../../../build/deps/I18N.dll.makefrag ... touch ../../../build/deps/I18N.dll.stamp MONO_PATH=../../../class/lib:$MONO_PATH mono ../../../mcs/mcs.exe /r:mscorlib.dll -d:NET_1_1 -d:ONLY_1_1 -g /noconfig /target:library /out:../../../class/lib/I18N.dll @I18N.dll.sources Notice the call to mono. In order to fix this, change the line in build/rules.make that says: INTERNAL_MCS = $(RUNTIME) $(topdir)/mcs/mcs.exe to: INTERNAL_MCS = /usr/local/bin/mint $(topdir)/mcs/mcs.exe I have not been able to figure out how to change $(RUNTIME) to resolve to mint, thus the change. I totally forgot about this change and have to admit that I didn't look at your error closely. :( rob PS. This is bug 55987. Unhandled Exception: System.ExecutionEngineException: SIGILL ---(snip!)--- ...any ideas what this means? I'm using the default profile, and the mono 0.31 packages I just put up in Fink unstable. ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] How do you compile Mono on SPARC Solaris ?
Hi. I've been trying to compile Mono CVS on SPARC Solaris 8. I've got the http://go-mono.com/mono-build.sh and run it. It went up to : gcc-3.0 -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../libgc/include -I/virtdev2/gkodinov/mono-0.31/script/install/include/glib-2.0 -I/virtdev2/gkodinov/mono-0.31/script/install/lib/glib-2.0/include -D_REENTRANT -I/virtdev2/gkodinov/mono-0.31/script/install/include/glib-2.0 -I/virtdev2/gkodinov/mono-0.31/script/install/lib/glib-2.0/include -I/virtdev2/gkodinov/mono-0.31/script/install/include -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=500 -D__EXTENSIONS__ -D_XOPEN_SOURCE_EXTENDED=1 -DNO_UNALIGNED_ACCESS -g -O2 -fno-strict-aliasing -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings -Wno-char-subscripts -MT tramp-sparc.lo -MD -MP -MF .deps/tramp-sparc.Tpo -c tramp-sparc.c -o tramp-sparc.o /dev/null 21 mv -f .libs/tramp-sparc.lo tramp-sparc.lo /bin/bash ../../libtool --mode=link gcc-3.0 -g -O2 -fno-strict-aliasing -g -Wall -Wunused -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-cast-qual -Wcast-align -Wwrite-strings -Wno-char-subscripts -L/virtdev2/gkodinov/mono-0.31/script/install/lib -o libmono.la -rpath /virtdev2/gkodinov/mono-0.31/script/install/lib -Wl,-version-script=./ldscript mini.lo trace.lo dominators.lo cfold.lo regalloc.lo inssel.lo helpers.lo liveness.lo ssa.lo driver.lo debug-mini.lo linear-scan.lo aot.lo graph.lo mini-sparc.lo exceptions-sparc.lo tramp-sparc.lo ../../mono/metadata/libmonoruntime.la ../../mono/metadata/libmetadata.la ../../mono/io-layer/libwapi.la ../../mono/utils/libmonoutils.la ../../libgc/libmonogc.la -lrt -lsocket -lnsl -lxnet -lpthread -lm -lrt rm -fr .libs/libmono.la .libs/libmono.* .libs/libmono.* /usr/ccs/bin/ld -G -h libmono.so.0 -o .libs/libmono.so.0.0.0 mini.lo trace.lo dominators.lo cfold.lo regalloc.lo inssel.lo helpers.lo liveness.lo ssa.lo driver.lo debug-mini.lo linear-scan.lo aot.lo graph.lo mini-sparc.lo exceptions-sparc.lo tramp-sparc.lo -z allextract ../../mono/metadata/.libs/libmonoruntime.al ../../mono/metadata/.libs/libmetadata.al ../../mono/io-layer/.libs/libwapi.al ../../mono/utils/.libs/libmonoutils.al ../../libgc/.libs/libmonogc.al -z defaultextract -L/virtdev2/gkodinov/mono-0.31/script/install/lib -lsocket -lnsl -lxnet -lpthread -lm -lrt -lc -version-script=./ldscript /usr/ccs/bin/ld: illegal option -- v usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:CD:F:GI:L:M:N:P:Q:R:S:VY:?] file(s) Can somebody write a FAQ or something (or extend the compilation section) with building instructions for all the non-linux platforms ? I can volunteer to experiment with the compilations steps on various platforms (I can even write some, but I don't know how much will they be approved by the relevant port maintainers ;-). Best Regards, -- George Kodinov Email : [EMAIL PROTECTED] DeveloperWeb : http://www.openlinksw.com OpenLink SoftwarePhone : +359 32 634 397 XML E-Business Infrastructure Technology Providers begin:vcard fn:George Kodinov n:Kodinov;George org:OpenLink Software;Virtuoso adr:;;8 Bulair Str.;Plovdiv;Plovdiv;4003;Bulgaria email;internet:[EMAIL PROTECTED] title:Developer tel;work:+359 32637475 tel;cell:+359 887 700566 x-mozilla-html:TRUE url:http://www.openlinksw.com version:2.1 end:vcard
[Mono-list] System.Exception.Security when mixing mono with microsoft
Hello, I'm trying to write a program that uses the mono system.dll but with the Microsoft runtime, but I'm getting an exception of type System.Security.SecurityException wiwth additional information: security error. On trying to resolve a hostname: System.Net.IPHostEntry tmp = System.Net.Dns.GetHostByName(value); Causes the error. I've read this would be caused by not running the program locally, but it is. Any ideas? Thank you =) ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] CodeDom testcases/examples
Does anyone know of any simple language-independent CodeDom testcases/examples that could be used to generate some code that a human could then look at and verify? Ideally some examples that start off doing really simple stuff (I guess defining an empty class in a given namespace would qualify), with gradually increasing complexity to eventually cover all the language features that CodeDom can express... If not, could the existing tests in mcs/class/System/Tests/Microsoft.* be used as the basis for starting something like that? Do other people agree that it would be a nice thing to have? As a later feature, I suppose you could test the compilation aspects of CodeDom by compiling the results for each language and using reflection to examine and invoke them. That would give a really nice testsuite for any new language that wants to be CodeDom-capable, and could probably supercede some of the tests in mcs/class/System/Tests altogether (just auto-enumerate all the languages defined in machine.config and run this testsuite against each one). Stuart. -- Stuart Ballard, Senior Web Developer NetReach, Inc. (215) 283-2300, ext. 126 http://www.netreach.com/ ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] mono and comercial apps.
My company has built a sophisticated .net app using a combination of J#, C# and comercial third party controls. Is there now or will there ever be a way to run an app like this on linux mono? Licensing a copy of windows for the linux machine just to get the .net runtime (presuming that windows assemblies can be used) would not be a problem for the short term. We are committed to cross platform compatability and this gui app is the only non portable product in our suite. wcn ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] SIGILL in I18N on OSX
On Wed, 2004-03-24 at 11:29, Robert Shade wrote: I have not been able to figure out how to change $(RUNTIME) to resolve to mint, thus the change. Putting RUNTIME = mint in build/config.make doesn't work? Peter -- Peter Williams [EMAIL PROTECTED] [Ninjas] are cool; and by cool, I mean totally sweet. -- REAL Ultimate Power ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono and comercial apps.
Hello, I am going to adress the pratical issues you bring up. I am not sure about legal issues (such as licensing Windows to use the J# assemblies). On Wed, 2004-03-24 at 13:58, Wendell Nichols wrote: J#, Assuming the J# assemblies comply to the CLI specs (which I assume, but have not verified, they do) they should run on Mono. However, there might be pathing issues, as I am not sure the J# designers were keeping in mind Linux. They might use \ as the path seperator char. If this were the case, you might have to round trip the j# assemblies in an ilassembler and fix bugs. Of course, you would have to check if this were compliant with the EULA. One other option might be to use the ikvm (http://www.ikvm.net/) to simulate the java classlibs. The issue would be getting things to compile. and comercial third party controls. There are a few possible issues here: 1. Most component venders obfuscate their code. Some code obfuscators emit code that does not comply to the CLI specification, and is thus invalid. Some of these invalid sequences are incorrectly accepted by Microsoft's jit, while our jit compliantly rejects them. 2. I have seen many third party components that store licencing information in the registry obviously this is a problem 3. As above, a third party component might not be built with linux in mind and might hardcode the path seperator char, etc. All three issues are things that you could obviously bring up with the vendor. Is there now or will there ever be a way to run an app like this on linux mono? Short of the above issues, or any issues in your own code, this application should run on Mono. If it does not, bug reports would help us to help you get the application running. Good luck, -- Ben ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] SIGILL in I18N on OSX
No rob Peter Williams wrote: On Wed, 2004-03-24 at 11:29, Robert Shade wrote: I have not been able to figure out how to change $(RUNTIME) to resolve to mint, thus the change. Putting RUNTIME = mint in build/config.make doesn't work? Peter ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Problems with Serialisation
This bug is now fixed in CVS. On dj, 2004-03-18 at 13:03, Michael Kämpf wrote: I tried the following code example. It works fine using the Microsoft Csharp-Compiler, but doesn't under Mono using System; using System.Xml; using System.Xml.Serialization; using System.IO; namespace TestSerialisation { /// summary /// Zusammenfassung für Class1. /// /summary public class Class1 { /// summary /// Der Haupteinstiegspunkt für die Anwendung. /// /summary [STAThread] static void Main(string[] args) { TestNS.ExponentialDistribution expDist = new TestNS.ExponentialDistribution(); TestNS.ElementAttributeMatrix2 attrib = new TestNS.ElementAttributeMatrix2(); TestNS.Distribution attrib2 = new TestNS.Distribution(); // dosn't work attrib.SetValue(0, expDist); // work //attrib.SetValue(0, attrib2); // error while serialisation XmlSerializer ser2 = new XmlSerializer(typeof(TestNS.ElementAttributeMatrix2)); TextWriter writer2 = new StreamWriter(class2.xml); ser2.Serialize(writer2, attrib); writer2.Close(); Console.WriteLine(Return-Taste drücken ...); Console.ReadLine(); } } } namespace TestNS { [Serializable()] public class Distribution { public Distribution() { } } [Serializable()] public class ExponentialDistribution : TestNS.Distribution { private double m_Lambda = double.NaN; public ExponentialDistribution() { } public double Lambda { set { this.m_Lambda = value; } get { return this.m_Lambda; } } } [Serializable] public class ElementAttributeMatrix2 { private object[] m_Values2; #region constructors public ElementAttributeMatrix2() { } #endregion //public void SetValue(int x, TestNS.ExponentialDistribution2 _Dist) public void SetValue(int x, object _Dist) { this.m_Values2 = new object[1]; ((object[]) this.m_Values2)[0] = new object[1]; ((object[]) ((object[]) this.m_Values2)[0])[0] = new object[x + 1]; ((object[]) ((object[]) ((object[]) this.m_Values2)[0])[0])[0] = _Dist; } [XmlArrayItem(typeof(object))] [XmlArrayItem(typeof(object[]))] [XmlArrayItem(typeof(TestNS.Distribution))] [XmlArrayItem(typeof(TestNS.Distribution[]))] [XmlArrayItem(typeof(TestNS.ExponentialDistribution))] [XmlArrayItem(typeof(TestNS.ExponentialDistribution[]))] public object[] MatrixValues { set { this.m_Values2 = value; } get { return this.m_Values2; } } } } Can you help me? with friendly reguards Michael Kaempf ___ Michael Kaempf Email: [EMAIL PROTECTED] [EMAIL PROTECTED] Tel.: 0175/7909349 0371/9097234 ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] mono and comercial apps.
J# requires one aditional framework compatible with java Ben Maurer wrote: Hello, I am going to adress the pratical issues you bring up. I am not sure about legal issues (such as licensing Windows to use the J# assemblies). On Wed, 2004-03-24 at 13:58, Wendell Nichols wrote: J#, Assuming the J# assemblies comply to the CLI specs (which I assume, but have not verified, they do) they should run on Mono. However, there might be pathing issues, as I am not sure the J# designers were keeping in mind Linux. They might use "\" as the path seperator char. If this were the case, you might have to round trip the j# assemblies in an ilassembler and fix bugs. Of course, you would have to check if this were compliant with the EULA. One other option might be to use the ikvm (http://www.ikvm.net/) to simulate the java classlibs. The issue would be getting things to compile. and comercial third party controls. There are a few possible issues here: 1. Most component venders obfuscate their code. Some code obfuscators emit code that does not comply to the CLI specification, and is thus invalid. Some of these invalid sequences are incorrectly accepted by Microsoft's jit, while our jit compliantly rejects them. 2. I have seen many third party components that store licencing information in the registry obviously this is a problem 3. As above, a third party component might not be built with linux in mind and might hardcode the path seperator char, etc. All three issues are things that you could obviously bring up with the vendor. Is there now or will there ever be a way to run an app like this on linux mono? Short of the above issues, or any issues in your own code, this application should run on Mono. If it does not, bug reports would help us to help you get the application running. Good luck, -- Ben ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] SIGILL in I18N on OSX
On Wed, 2004-03-24 at 14:57, Robert Shade wrote: No rob Ok, have you tried changing the definition of RUNTIME in build/config-default.make? Strange that the config.make change doesn't cut it; maybe that needs RUNTIME := mint to get it to stick. Peter -- Peter Williams [EMAIL PROTECTED] [Ninjas] are cool; and by cool, I mean totally sweet. -- REAL Ultimate Power ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] System.Exception.Security when mixing mono with microsoft
Ofer, Non local assemblies (e.g. network drives) are given much less freedom than local ones by the MS runtime. Some ressources (like DNS) requires specific permissions (like DnsPermission). However if you're using Mono's System.dll under MS runtime the security exception is (most probably) because it tried to call unmanaged code (which isn't permitted by default to non-local assemblies). Sebastien Pouliot http://pages.infinit.net/ctech/poupou.html -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Ofer Achler Sent: 24 mars 2004 13:10 To: [EMAIL PROTECTED] Subject: [Mono-list] System.Exception.Security when mixing mono with microsoft Hello, I'm trying to write a program that uses the mono system.dll but with the Microsoft runtime, but I'm getting an exception of type System.Security.SecurityException wiwth additional information: security error. On trying to resolve a hostname: System.Net.IPHostEntry tmp = System.Net.Dns.GetHostByName(value); Causes the error. I've read this would be caused by not running the program locally, but it is. Any ideas? Thank you =) ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] General .NET Q
Does anyone know if the following is possible: Taking a snippet of .NET c# code, maybe a function, and storing it in a mysql db to be later called by another piece of code and executed? I was asked this question by a client and I dont have the slightest clue on how to answer this. My initial answer is no because it would have to be compiled into the calling class; however, I am thinking that system.reflection would be able to help me. Any opinions or direction would be greatly appreciated. Regards, Shawn Vose ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] General .NET Q
Below... On Wed, 2004-03-24 at 21:05, Shawn Vose wrote: Does anyone know if the following is possible: Taking a snippet of .NET c# code, maybe a function, and storing it in a mysql db to be later called by another piece of code and executed? I was asked this question by a client and I dont have the slightest clue on how to answer this. My initial answer is no because it would have to be compiled into the calling class; however, I am thinking that system.reflection would be able to help me. Is it possible? Yes. Will System.Reflection do it? It depends. It can't do it alone, though. The easiest thing to do would be to: 1. Define an interface 2. Use System.CodeDom to (a) generate skeleton C# code, (b) include the code from the database into the CodeDom code, and (c) compile the code into an assembly. The CodeDom code should implement the interface defined in (1). 3. Load the assembly at runtime 4. Instantiate the type from the assembly at runtime, through the numerous mechanisms .NET provides (Activator.CreateInstance, etc.) 5. Cast the type created in (4) to the interface defined in (1) 6. Invoke the code via the interface method. A Variation would be to use a delegate instead of the interface. A pitfall with this framework is that all methods defined in the database must conform to a single interface, so you couldn't have methods with different argument lists and return types defined this way. To work around that, you could use System.Reflection.MethodInfo, but this complicates your client code as you need not only need to know what function to call, but also what arguments to provide it, what it returns, etc. This can be done, it's just not as simple or as fast as the above solution. (Regarding performance, CodeDom generation will be slow, but it can't be avoided. Method invocation also can't be avoided, but delegate/interface invocation is *much* faster than MethodInfo.Invoke, so if this code will be invoked frequently, a well-defined delegate/interface would be preferred.) - Jon ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] UDP Broadcast Socket.ReceiveFrom Anomalies
I'm writing (actually trying to simulate) a simple UDP client and I've noticed some anomalies between Mono 0.31 and .NET in terms of the handling the messages. I'm assuming because the replies from the server are broadcasts. 1) C: 1.1.1.1 - 1.1.1.2 (or 1.1.1.255) S: 2) S: 1.1.1.2 - 1.1.1.255 C: With mono, the client only gets the data from the server if the message 1 is sent to the server's broadcast address. The client ignores the data if it was sent to the server's unicast address. With .NET it receives the data regardless of the destination address of message 1. Whether or not the socket option is set to broadcast doesn't make any difference. In both cases the server is responding the same (verified with tcpdump) and there isn't anything weird (like non-Ethernet II frames) at the datalink layer. There is also a discrepancy between the value returned by s.Available. Mono returns just the length of the next message but .NET returns the length of all the responses. And I've seen http://bugzilla.ximian.com/show_bug.cgi?id=45959 Any ideas? I'm assuming I made a simple mistake, and .NET is more forgiving? = mdf IPEndPoint ep = new IPEndPoint(ip,dport); //remote IPEndPoint lep = new IPEndPoint(IPAddress.Any,sport); //local Socket s = new Socket(AddressFamily.InterNetwork,SocketType.Dgram,ProtocolType.Udp); if (dstbcast) { s.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.Broadcast,1); } s.Bind(lep); try { s.SendTo(Message1, ep); } catch (Exception e) { Console.WriteLine(e.ToString()); } byte[] rBuffer = new byte[1500]; IPEndPoint sender = new IPEndPoint(IPAddress.Any,0); EndPoint target = (EndPoint)sender; System.Console.WriteLine({0} bytes in the buffer,s.Available); while (s.Available 0) { int recv_bytes = s.ReceiveFrom(rBuffer, ref target); // For some reason we are getting our own message with ReceiveFrom // and this doesn't work for multihomed if (target == sender) { continue; } System.Console.Write ({0} bytes ,recv_bytes); System.Console.WriteLine(Received from:+((IPEndPoint)target).Address.ToString()+\n ); for (int i=0; irecv_bytes; i++) { Console.Write({0:X} ,rBuffer[i]); } Console.WriteLine(\n); } s.Close(); -- | Matthew Franz [EMAIL PROTECTED] | | http://www.io.com/~mdfranz | ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list
RE: [Mono-list] I broke XSP
It definitely exists. I have directory browsing on and I can actually click the file and it still 404's. -Abe = Original Message From donaldi sp [EMAIL PROTECTED] = Abram Gillespie wrote: Hey All, I seem to have broken XSP somehow. I was having a problem with an ASP.NET page where I was using codebehind as opposed to inline code. It took me a while to get it working, but I finally did. However, when I made changes to the code, the changes didn't propagate (at least as far as I could tell, is this a bug?). So I tried deleting the cached dlls in /tmp. This may have been the step that broke things. Now whenever I try to hit my pages I get: Server error in '/mono' application Cannot find '/mono/whatever_test_page.aspx'. Description: Error processing request. Error Message: HTTP 404. Cannot find '/mono/whatever_test_page.aspx'. (where whatever_test_page is any example page that comes with mono) I've tried rebooting and deleting .wapi (as per another post). No dice. Thanks in advance as always. -Abe ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list make sure that file is exist, especially the case sensitive isue ___ Mono-list maillist - [EMAIL PROTECTED] http://lists.ximian.com/mailman/listinfo/mono-list