[Mono-winforms-list] drag and drop file to desktop doesn't work
Hi, Mono-newbie, so please bear with me! I have a simple C# winform app (.net 3.5) that populates a listbox with the files from a folder. The goal is to drag and drop a selected file FROM the app TO the desktop (or another app), which this does in normal run mode. When I run it under Mono - I cannot drag nor drop the filename. My code is as below (simple form with a single list box). It populates the list box fine, but no dragging available: public partial class Form1 : Form { public Form1() { InitializeComponent(); string[] filePaths = Directory.GetFiles(@C:\TEMP\); listBox1.DataSource = filePaths; } private void listBox1_MouseDown(object sender, MouseEventArgs e) { StringCollection fileList = new StringCollection(); fileList.Add(listBox1.SelectedItem.ToString()); DataObject dataObj = new DataObject(); dataObj.SetFileDropList(fileList); listBox1.DoDragDrop(dataObj, DragDropEffects.Copy); } private void listBox1_DragOver(object sender, DragEventArgs e) { e.Effect = DragDropEffects.Copy; } } -- View this message in context: http://mono.1490590.n4.nabble.com/drag-and-drop-file-to-desktop-doesn-t-work-tp3691711p3691711.html Sent from the Mono - WinForms mailing list archive at Nabble.com. ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
[Mono-winforms-list] winforms main menu
Hello all, I have a question.. I've a simple winforms application with a main menu, this works fine under windows, but in osx I have issues with the main menu, if the application runs using the carbon driver it has lots of drawing glitches but the main menu works, and if it runs under X11 the main menu doesn't work after you use it one time..for example.. if you select an item from the file menu and try to select it again the menu will not pull down as you expect have any of you encounter this problem or is it a bug in mono winforms ?, also if it's a known bug can it be fixed or is there any other work around it ? thanks in advance. -- View this message in context: http://mono.1490590.n4.nabble.com/winforms-main-menu-tp3692388p3692388.html Sent from the Mono - WinForms mailing list archive at Nabble.com. ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
[Mono-winforms-list] winforms main menu
Hello all, I have a question.. I've a simple winforms application with a main menu, this works fine under windows, but in osx I have issues with the main menu, if the application runs using the carbon driver it has lots of drawing glitches but the main menu works, and if it runs under X11 the main menu doesn't work after you use it one time..for example.. if you select an item from the file menu and try to select it again the menu will not pull down as you expect have any of you encounter this problem or is it a bug in mono winforms ?, also if it's a known bug can it be fixed or is there any other work around it ? thanks in advance. -- View this message in context: http://mono.1490590.n4.nabble.com/winforms-main-menu-tp3692389p3692389.html Sent from the Mono - WinForms mailing list archive at Nabble.com. ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
Re: [Mono-winforms-list] winforms main menu
Although I didn't check out this bug, I'm pretty sure it must be a Mono WinForms bug. I can't see why it couldn't be fixed. However, the Mono team doesn't work on Windows anymore, so the patch would have to come from the community. focusgfx wrote: Hello all, I have a question.. I've a simple winforms application with a main menu, this works fine under windows, but in osx I have issues with the main menu, if the application runs using the carbon driver it has lots of drawing glitches but the main menu works, and if it runs under X11 the main menu doesn't work after you use it one time..for example.. if you select an item from the file menu and try to select it again the menu will not pull down as you expect have any of you encounter this problem or is it a bug in mono winforms ?, also if it's a known bug can it be fixed or is there any other work around it ? thanks in advance. -- View this message in context: http://mono.1490590.n4.nabble.com/winforms-main-menu-tp3692388p3692552.html Sent from the Mono - WinForms mailing list archive at Nabble.com. ___ Mono-winforms-list maillist - Mono-winforms-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-winforms-list
[Mono-dev] XmlTextReader problems in mono 2.10.2
Hi,I'm having problems reading UTF-8 encoded XML files, only in mono on Linux and MacOSX (2.10.2 and 2.10.1 respectively). 2.10.2 on Windows 7 64 bit runs just fine, as does .NET The issue is that the XmlTextReader can't open an XML file with UTF-8 encoding, it comes up with an old error, '?' is Expected as Mono.Xml2.XmlTextReader.Expect. This seems true of any Xml file, as long as it is UTF-8 encoded, which I need for multiple language support, as I need translations inside the single XMl file. I am using the following code to initialise the XmlTextReader: XmlReaderSettings settings = new XmlReaderSettings(); settings.ConformanceLevel = ConformanceLevel.Auto; settings.IgnoreWhitespace = true; settings.IgnoreComments = true; settings.ValidationType = ValidationType.None; XmlReader reader = XmlReader.Create(IFXstream, settings); XmlDocument IFXmodel = new XmlDocument(); IFXmodel.Load(reader);Setting the ConformanceLevel.Auto fixed it running in Mono on Windows, but still left it broken on Linux and MacOSX. I tried converting the files to UTF-32, but then I just get a NullReferenceException. Converting to Western ISO won't work as gedit reports there are characters in the file that will be lost in the conversion. Any thoughts? Cheers, Euan. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Non-TCP/IP socket access
-Original Message- From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list-boun...@lists.ximian.com] On Behalf Of Robert Jordan Sent: 22 July 2011 17:12 To: mono-devel-list@lists.ximian.com Subject: Re: [Mono-dev] Non-TCP/IP socket access On 22.07.2011 18:04, Ivo Smits wrote: Op 22-7-2011 17:05, Andy Hume schreef: [...] However, looking at the mono code, there are no checks in the managed part of the Socket construction. Did I miss anything, is it in the unmanaged code perhaps? Have you tried to use the managed Socket There are checks. That's the whole point. So just to explain to Ivo and any other interested parties what happens in Sockets on Mono versus on MSFT. On MSFT implementations there are no restriction on the sockets values and types that can be used. For instance any address family can be used in Socket..ctor(af,t,p)[1]. There are also no restrictions on the EndPoint sub-classes that can be used, that class cleverly uses the Prototype Pattern with instance methods Serialize[2] converting to sockaddr as a byte[] and Create for the opposite direction (and noted before which is support in Mono since 2007-08-02). For instance we have simple BluetoothEndPoint (and e.g. IrDAEndPoint) classes that work both on the Win32 CLR and on the NETCF. Finally there any no restriction on socket options. Basically in all cases the values used by the caller are passed unchanged to the Winsock calls and vice versa. On Mono however there is the necessity to handle different platforms (Linux, OSX, Windows etc). Code for this has been placed in the runtime (native) code. It will convert the family values used in managed code (System.Net.Sockets.AddressFamily) to the platform equivalent and in reverse, it also remaps the layout of sockaddr structs, and finally does similar things for socket options. That's all good and well and useful for TCP/IP sockets as there is support on all platforms, it also works for UNIX sockets for instance. Currently other socket types are blocked. This occurs because the mapping functions will return an error if asked to handle a different address family. For instance see convert_family at mono/metadata/socket-io.c[3], when given an unknown value will skip it and return -1, similarly for the other direction convert_to_mono_family returns AddressFamily_Unknown. For Connect and Bind, they use create_sockaddr_from_object which for an unknown family returns: *error = WSAEAFNOSUPPORT; Hence why I can't use Socket directly currently. :-,( Andy _Footnotes/Details [1] For Socket the given family value will be passed directly though managed code to the CLR and to the native call. [2] For EndPoint, in-box support on desktop includes IPEndPoint, and on NETCF an addition is IrDAEndPoint. As a third-party we have successfully used our BluetoothEndPoint and IrDAEndPoint classes on both platforms. What happens is that for Connect/Bind the EndPoint.Serialize instance method is called by the managed Socket methods and the result byte array is passed directly through the CLR to the relevant native calls. Similar support exists for getting EndPoints _from_ native code, for Local-/RemoteEndPoint properties). There the EndPoint.Create instance method is used. (Apparently Serialize is called first to get a correctly-size buffer to pass down to the native code. [3] https://github.com/mono/mono/blob/master/mono/metadata/socket-io.c ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] Non-TCP/IP socket access
On 25.07.2011 15:24, Andy Hume wrote: Currently other socket types are blocked. This occurs because the mapping functions will return an error if asked to handle a different address family. For instance see convert_family at mono/metadata/socket-io.c[3], when given an unknown value will skip it and return -1, similarly for the other direction convert_to_mono_family returns AddressFamily_Unknown. For Connect and Bind, they use create_sockaddr_from_object which for an unknown family returns: *error = WSAEAFNOSUPPORT; Hence why I can't use Socket directly currently. :-,( They are really blocked on purpose, but this is not set in stone. You could, for example, provide patches that, for unknown (but not limited to) AFs, simply assume that the specified sockaddr is of the generic type struct sockaddr_storage (see RFC 2553). All Unixes (including OSX) and even Windows support this type. What we'd need is a platform dependent SocketAddress to sockaddr_storage mapping in the runtime. Robert ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] XmlTextReader problems in mono 2.10.2
I just confirmed that it does not reproduce (I am pretty sure it must not, as such problematic error would have flooded this list). If you still think there is bug, come up with the problematic test xml stream and corresponding code that creates the actual IFXstream. Atsushi Eno Hi, I'm having problems reading UTF-8 encoded XML files, only in mono on Linux and MacOSX (2.10.2 and 2.10.1 respectively). 2.10.2 on Windows 7 64 bit runs just fine, as does .NET The issue is that the XmlTextReader can't open an XML file with UTF-8 encoding, it comes up with an old error, '?' is Expected as Mono.Xml2.XmlTextReader.Expect. This seems true of any Xml file, as long as it is UTF-8 encoded, which I need for multiple language support, as I need translations inside the single XMl file. I am using the following code to initialise the XmlTextReader: XmlReaderSettings settings = new XmlReaderSettings(); settings.ConformanceLevel = ConformanceLevel.Auto; settings.IgnoreWhitespace = true; settings.IgnoreComments = true; settings.ValidationType = ValidationType.None; XmlReader reader = XmlReader.Create(IFXstream, settings); XmlDocument IFXmodel = new XmlDocument(); IFXmodel.Load(reader); Setting the ConformanceLevel.Auto fixed it running in Mono on Windows, but still left it broken on Linux and MacOSX. I tried converting the files to UTF-32, but then I just get a NullReferenceException. Converting to Western ISO won't work as gedit reports there are characters in the file that will be lost in the conversion. Any thoughts? Cheers, Euan. ___ 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] Problem with MySQL connection using ProviderFactory
Ok, I had to manually put the MySQL entry into the machine.config and it worked. -- View this message in context: http://mono.1490590.n4.nabble.com/Problem-with-MySQL-connection-using-ProviderFactory-tp3686395p3691750.html Sent from the Mono - General mailing list archive at Nabble.com.___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Class status
The class status page (http://go-mono.com/status/) is not working. When clicking on a Class it tells: Column count of mysql.proc is wrong. Expected 20, found 16. The table is probably corrupted. The gui-compare tool doesn't work eather. Where can I find up to date information about class status (especially WCF)? Regards Michael -- View this message in context: http://mono.1490590.n4.nabble.com/Class-status-tp3692336p3692336.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Mono Gtk Documentation gone
The page http://docs.go-mono.com/ is listing Gdk instead of Gtk and the link http://docs.go-mono.com/Gtk gives an error. -Doug ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] WCF Hosting Problem
Hi, sorry for a delayed response. If you are referring to http://veritas-vos-liberabit.com/monogatari/2009/12/mono-wcf-advent-day-6-aspnet-hosting.html this sample, then I couldn't get it to work. I get the same error. -Vinod -- View this message in context: http://mono.1490590.n4.nabble.com/WCF-Hosting-Problem-tp3682894p3693024.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] WCF Hosting Problem
Then as I replied to this thread earlier, it is fixed in git master and 2-10 branches. Atsushi Eno Hi, sorry for a delayed response. If you are referring to http://veritas-vos-liberabit.com/monogatari/2009/12/mono-wcf-advent-day-6-aspnet-hosting.html this sample, then I couldn't get it to work. I get the same error. -Vinod -- View this message in context: http://mono.1490590.n4.nabble.com/WCF-Hosting-Problem-tp3682894p3693024.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] Advantages to Using Mono
Hey All, I'm trying to make a case for using Mono for a new project coming up and was hoping that this list could help me with that decision. The situation we are in is that we have a smallish development team with extensive experience working .net with visual studio 2010. We would like to develop a new high availability web application using jQuery and jQueryUI within a MVC framework while utilizing the development tools in visual studios. We currently have a web farm consisting of linux servers running apache (and hosting some legacy products that can't get moved) and the shear cost of new hardware plus Microsoft license fees for those webservers is forcing us to search for another solution. Here seemingly enters Mono. Seems that mono would be a great fit since we could use mono-tools assist in the development in VS2010, as well as using the VS2010 debugging tools and then deploy to our current apache server farm updated to run mod_mono. There is a bit of hesitation however involved with some parties that mono will not provide the speed/reliability of a fully native windows solution. Do people think running mono in this configuration would be reasonable close to running IIS when considering speed and reliability? In addition if we are using the mono tools migration analysis can we be pretty confident that deployment will be fairly free of compatibility issues? Any thoughts? Thanks for you assistance -- View this message in context: http://mono.1490590.n4.nabble.com/Advantages-to-Using-Mono-tp3693668p3693668.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] Advantages to Using Mono
spamname5 wrote: I'm trying to make a case for using Mono for a new project coming up and was hoping that this list could help me with that decision. We would like to develop a new high availability web application using jQuery and jQueryUI within a MVC framework while utilizing the development tools in visual studios. We currently have a web farm consisting of linux servers running apache (and hosting some legacy products that can't get moved) and the shear cost of new hardware plus Microsoft license fees for those webservers is forcing us to search for another solution. Well, I think you answered your own question there. The advantage of using Mono is that you get to use Linux (your existing Linux servers) without abandoning your .NET and Visual Studio skills. My own experience is that Mono works very, very well for ASP.NET MVC. In general, I recommend it highly. For your setup, will it be as performant and reliable as .NET? Well, I guess that depends. Mono is generally similar in speed to .NET although a little slower overall. There are cases where it is faster. I doubt your performance will be limited by Mono though. I/O and database stuff will likely be the killer and I would rather be using Linux when solving that problem. There are two garbage collectors available for Mono at this point. The new one 'sgen' seems to handle complex loads more gracefully. I would already say it is your best bet. It is not the default though so there may be some workloads for which it is not the answer. You may want to profile your stuff on each of them. Other people may be able to comment more about this. Overall, I have found Mono to be very reliable. There is certainly a greater degree of flux in Mono though and it is not as widely deployed. I believe you are much more likely to run into bugs in Mono than with .NET. The good news is that the Mono team rocks. Usually fixes come quickly and you can deploy them immediately without having to wait for a new build. Fixes do not always come though as Mono itself is not a commercially supported product. Well, that is unless you are using SUSE and paying for the enterprise extensions but I have no experience with that. You can, at the very least, get in there and fix the problem yourself. You cannot beat Open Source for that. Compatibility in the core technologies is excellent. WCF is pretty weak on Mono still. You may want to check out ServiceStack instead. You cannot use Entity Framework and probably do not want to use LINQ2SQL. NHibernate and other options do work well though. I find that generally third-party libraries work well on Mono but it is not always the case. Officially, Razor is not available on Mono but it does work well if you bring over the DLLs. I have ASP.NET MVC 3 apps running on Mac and Linux that use Razor. Naturally, there is also Spark and other options (including good old Web Forms of course which ships with Mono). For what it is worth, the ASP.NET MVC code itself was written by Microsoft. They released it under Apache 2.0 and Mono builds from that. This is true of the F# language as well if you were considering that. You should talk to Xamarin to see if the Mono tools for Visual Studio are still available. They sound like they would work for you. -- View this message in context: http://mono.1490590.n4.nabble.com/Advantages-to-Using-Mono-tp3693668p3693993.html Sent from the Mono - General mailing list archive at Nabble.com. ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
[Mono-list] System.DivideByZeroException in HashTable?
I sometimes get this exception (mono 2.8) - running fully bundled (exe + deps). It happens very rarely. 64 bit suse system. How is this exception possible? Stack Trace: at System.Collections.Hashtable..ctor (Int32 capacity, Single loadFactor, IHashCodeProvider hcp, IComparer comparer) [0x0] in filename unknown:0 at System.Collections.Hashtable..ctor (Int32 capacity, Single loadFactor) [0x0] in filename unknown:0 at System.Collections.Hashtable..ctor (Int32 capacity) [0x0] in filename unknown:0 at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x0] in filename unknown:0 at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, Boolean inherit) [0x0] in filename unknown:0 at System.Reflection.MonoField.GetCustomAttributes (Boolean inherit) [0x0] in filename unknown:0 Code from hashtable: public Hashtable (int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) { if (capacity0) throw new ArgumentOutOfRangeException (capacity, negative capacity); if (loadFactor 0.1f || loadFactor 1.0f || Single.IsNaN (loadFactor)) throw new ArgumentOutOfRangeException (loadFactor, load factor); if (capacity == 0) ++capacity; this.loadFactor = 0.75f*loadFactor; double tableSize = capacity / this.loadFactor; if (tableSize Int32.MaxValue) throw new ArgumentException (Size is too big); int size = (int) tableSize; size = ToPrime (size); this.SetTable (new Slot [size], new int [size]); this.hcp = hcp; this.comparer = comparer; this.inUse = 0; this.modificationCount = 0; } The only divide in there is is a float divide. It wouldn't try to convert 'this.loadFactor' to an int and then do int divide would it? Thanks ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list
Re: [Mono-list] System.DivideByZeroException in HashTable?
Is the instance variable 'this.loadFactor' by any chance of integer type? Regards, Bernardo van der Wal On Jul 26, 2011 5:01 AM, Ben Pryor salexwh...@gmail.com wrote: I sometimes get this exception (mono 2.8) - running fully bundled (exe + deps). It happens very rarely. 64 bit suse system. How is this exception possible? Stack Trace: at System.Collections.Hashtable..ctor (Int32 capacity, Single loadFactor, IHashCodeProvider hcp, IComparer comparer) [0x0] in filename unknown:0 at System.Collections.Hashtable..ctor (Int32 capacity, Single loadFactor) [0x0] in filename unknown:0 at System.Collections.Hashtable..ctor (Int32 capacity) [0x0] in filename unknown:0 at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x0] in filename unknown:0 at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, Boolean inherit) [0x0] in filename unknown:0 at System.Reflection.MonoField.GetCustomAttributes (Boolean inherit) [0x0] in filename unknown:0 Code from hashtable: public Hashtable (int capacity, float loadFactor, IHashCodeProvider hcp, IComparer comparer) { if (capacity0) throw new ArgumentOutOfRangeException (capacity, negative capacity); if (loadFactor 0.1f || loadFactor 1.0f || Single.IsNaN (loadFactor)) throw new ArgumentOutOfRangeException (loadFactor, load factor); if (capacity == 0) ++capacity; this.loadFactor = 0.75f*loadFactor; double tableSize = capacity / this.loadFactor; if (tableSize Int32.MaxValue) throw new ArgumentException (Size is too big); int size = (int) tableSize; size = ToPrime (size); this.SetTable (new Slot [size], new int [size]); this.hcp = hcp; this.comparer = comparer; this.inUse = 0; this.modificationCount = 0; } The only divide in there is is a float divide. It wouldn't try to convert 'this.loadFactor' to an int and then do int divide would it? Thanks ___ Mono-list maillist - Mono-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-list