[Mono-dev] [patch] implements RuntimeLicenseContext (Deserialization) design time serialization
The attached patch implements the loading into the runtime license context to allow pre-compiled websites applications with licenses to properly run. It also implements the DesignTimeLicenseContext serialization support so once an LC compiler is written it can actually generate licenses. comments appreciated. -- Carlo Kok RemObjects Software The Infrastructure Company http://www.remobjects.com Index: Changelog === --- Changelog (revision 144003) +++ Changelog (working copy) @@ -1,3 +1,8 @@ +2009-10-12 Carlo Kok c...@remobjects.com + + * DesigntimeLicenseContextSerializer.cs: Properly serialize licenses. + * RuntimeLicenseContext.cs: Properly deserialize licenses. + 2008-06-18 Ivan N. Zlatev cont...@i-nz.net * ServiceContainer.cs: Lazy initialize the services hashtable so that Index: DesigntimeLicenseContextSerializer.cs === --- DesigntimeLicenseContextSerializer.cs (revision 144003) +++ DesigntimeLicenseContextSerializer.cs (working copy) @@ -4,9 +4,11 @@ // Authors: // Martin Willemoes Hansen (m...@sysrq.dk) // Andreas Nahr (classdevelopm...@a-softtech.com) +// Carlo Kok (c...@remobjects.com) // // (C) 2003 Martin Willemoes Hansen // (C) 2003 Andreas Nahr +// (C) 2009 Carlo Kok // // @@ -31,6 +33,8 @@ // using System.IO; +using System.Runtime.Serialization.Formatters.Binary; +using System.Collections; namespace System.ComponentModel.Design { @@ -41,12 +45,23 @@ { } - [MonoTODO] public static void Serialize (Stream o, string cryptoKey, DesigntimeLicenseContext context) { - throw new NotImplementedException(); +Object[] lData = new Object [2]; +lData [0] = cryptoKey; +Hashtable lNewTable = new Hashtable(); +foreach (DictionaryEntry et in context.keys) +{ +lNewTable.Add(((Type)et.Key).AssemblyQualifiedName, et.Value); +} +lData[1] = lNewTable; + +BinaryFormatter lFormatter = new BinaryFormatter (); +lFormatter.Serialize (o, lData); + } + } } Index: RuntimeLicenseContext.cs === --- RuntimeLicenseContext.cs(revision 144003) +++ RuntimeLicenseContext.cs(working copy) @@ -5,10 +5,12 @@ // Ivan Hamilton (i...@chimerical.com.au) // Martin Willemoes Hansen (m...@sysrq.dk) // Andreas Nahr (classdevelopm...@a-softtech.com) +// Carlo Kok (c...@remobjects.com) // // (C) 2004 Ivan Hamilton // (C) 2003 Martin Willemoes Hansen // (C) 2003 Andreas Nahr +// (C) 2009 Carlo Kok // // @@ -35,26 +37,77 @@ using System.ComponentModel; using System.Reflection; using System.Collections; +using System.IO; +using System.Runtime.Serialization.Formatters.Binary; namespace System.ComponentModel.Design { internal class RuntimeLicenseContext : LicenseContext { - private Hashtable keys = new Hashtable (); + private Hashtable keys; - public RuntimeLicenseContext () : base() + public RuntimeLicenseContext () : base () { } +private void loadKeys () +{ +if (keys != null) return; +keys = new Hashtable (); + +Assembly asm = Assembly.GetEntryAssembly (); +if (asm != null) +loadAssemblyLicenses (asm); +else { +foreach (Assembly asmnode in AppDomain.CurrentDomain.GetAssemblies ()) { +if (String.Compare (asmnode.GetName().Name, App_Licenses, true) == 0) +loadAssemblyLicenses (asmnode); +} +} +} + +private void loadAssemblyLicenses (Assembly asm) +{ +string asmname = Path.GetFileName (asm.Location); +string resourcename = asmname + .licenses; +try +{ +foreach (string name in asm.GetManifestResourceNames ()) +{ +if (name == resourcename) { +using (Stream stream = asm.GetManifestResourceStream (name)) +{ +BinaryFormatter formatter = new BinaryFormatter (); +object[] res = formatter.Deserialize (stream) as object[]; +if (String.Compare ((string) res[0], asmname, true) == 0) +{ +Hashtable table = (Hashtable) res[1]; +foreach (DictionaryEntry et in table) +
Re: [Mono-dev] Possible regression from revision 141535 (metadata/class.c - Use inheritance-aware interface offsets)?
I also getting the same issue with my application when running with latest mono trunk. (143887) version 141180 doesn't have this issue. I haven't yet divided can conquered to find the exact change that caused the issue. Tom On Mon, 2009-10-12 at 20:08 -0400, Sylvain Dupont wrote: Bill, I attach an example. It contains two Visual Studio 2008 solutions. First build COMExample\COMExample.sln and then ConsoleApplication1\ConsoleApplication1.sln (I can also build it for you if you run into any issue). When you run the app you should get: ** ERROR:cominterop.c:308:cominterop_get_method_interface: assertion failed: (ic) It works fine when using MS .Net. Sylvain The following message has been appended to this e-mail by JAARS e-mail gateway. Dan Zachary 704-843-6488 JAARS Waxhaw, North Carolina If you believe that this message is a scam or spam, we now have a new technique for detecting them. Samples are welcome. For instructions about how to report samples please see https://mail.jaars.org/~spam_ad...@sil.org/reportingspam.htm Message from JAARS WARNINGWARNINGWARNING Zip Files can contain harmful viruses SCAM WARNING: There is a current scam involving short messages and attached .zip files. They change hourly, so the anti-virus software does not always keep up with the new variations as quickly as we or you would like. If you were NOT EXPECTING to receive an attached ZIP file, consider it DANGEROUS until you confirm that your friend really did send you a ZIP file. Do NOT open the attached zip file unless you know the sender AND are expecting a zip file! Contact spam_ad...@sil.org if you have any questions -- ___ 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-dev] ASN.1 Implementation and Firefox PKCS#12
Hello Claus, This is a known issue documented in https://bugzilla.novell.com/show_bug.cgi?id=316337 Sadly using the new parser to re-implement everything ASN.1 related inside Mono is a large undertaking (and also will break binary compatibility in Mono.Security.dll) and this is a minor/rare issue so there are no planned timeframe for a fix. Sebastien On Tue, 2009-10-13 at 19:32 +0200, Claus Jørgensen wrote: Hi When using the PKCS12.LoadFromFile method to load a PKCS#12 file that was exported from Firefox, a Undefined length encoding. exception occours, and after stacktracing this boils down to a check of the value of the second byte in the file in the ASN.1 class. According to this the nLength cannot be equal to 0x80, but in our exported certificate from Firefox the second byte value is 80, so we tested with pk12util, and it confirms the certificate from Firefox is valid. This leads me to the conclusion that the ASN.1 implementation is wrong, or the exception check was meant to do something else originally, and after discussing it with some people on IRC I was suggested to mail this mailing list, and Sebastian Pouliot. I must admit looking though the 146 pages of specification on the ASN.1 format isn't what I wanted to spend my autumn holiday on, so I hope I can get some more insight though from here. Sincerely Claus Jørgensen ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
[Mono-dev] tcmalloc
Hi there, Dick and I were talking about it today and most likely it wouldn't have a big impact since Mono does use mmap instead but.. do you guys think using tcmalloc would be worth? http://goog-perftools.sourceforge.net/doc/tcmalloc.html It's not new, but I've just found it reading the MySql 5.4 release notes, and it seems it helps boosting its performance http://mysqlha.blogspot.com/2009/01/double-sysbench-throughput-with_18.html Would it help? pablo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] asp.net application accessible via http and https
On Tue, 2009-10-13 at 10:18 +0200, Cyrille Colin wrote: hi all, i would like to run an asp.net application accessible via http and https simultaneously on linux and use Request.IsSecureConnection to know protocol that have been used. Is there a way to configure mod-mono or apache to have this beahavior ? thanks for help. Just enable SSL in apache and in the your virtual host in which you run mono. mod_mono will pass the appropriate variables to mod-mono-server so that IsSecureConnection will return what you expect. -Gonzalo ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] there is a free mono for Andrioid or Wii?
Does anyone know if these changes have been pulled into the trunk? Can I pull down a fresh tree from the trunk and expect it to build on android, or do I Need to patch? -Original Message- From: mono-devel-list-boun...@lists.ximian.com [mailto:mono-devel-list- boun...@lists.ximian.com] On Behalf Of Jonathan Pryor Sent: Wednesday, October 07, 2009 11:56 AM To: buhochil...@gmail.com Cc: Mono devel list Subject: Re: [Mono-dev] there is a free mono for Andrioid or Wii? On Wed, 2009-10-07 at 10:03 -0400, buhochil...@gmail.com wrote: There is some free mono version for Andrioid Mono should be buildable from source for Android, though I don't know how complicated or involved the process is. You might try following: http://www.koushikdutta.com/search/label/Mono IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses. ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list
Re: [Mono-dev] tcmalloc
I've tested it in the past (extensibly during 2.4 cycle) with negligible changes in performance on 2, 4, and 8 core boxes. -- Christian On Oct 13, 2009, at 2:10 PM, Zoltan Varga wrote: Hi, We use malloc for allocating runtime memory structures etc., but in a server app, that all happens during startup, so it doesn't help much. Zoltan On Tue, Oct 13, 2009 at 11:05 PM, pablosantosl...@terra.es pablosantosl...@terra.es wrote: Hi there, Dick and I were talking about it today and most likely it wouldn't have a big impact since Mono does use mmap instead but.. do you guys think using tcmalloc would be worth? http://goog-perftools.sourceforge.net/doc/tcmalloc.html It's not new, but I've just found it reading the MySql 5.4 release notes, and it seems it helps boosting its performance http://mysqlha.blogspot.com/2009/01/double-sysbench-throughput-with_18.html Would it help? pablo ___ 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 ___ Mono-devel-list mailing list Mono-devel-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-devel-list