This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I'm trying to get some code up and running under Mono, and I've run into a difficulty with LightSpeed. From what I can tell, the obfuscator has inserted some invalid, unreachable IL into a method that gets called by the type initialiser for Mindscape.LightSpeed.LightSpeedContext. A log from the Mono C# shell follows.
---
Mono C# Shell, type "help;" for help
Enter statements below.
csharp> LoadAssembly("Mindscape.LightSpeed");
csharp> Mindscape.LightSpeed.LightSpeedContext.Default;
System.TypeInitializationException: An exception was thrown by the type initializer for Mindscape.LightSpeed.LightSpeedContext ---> System.InvalidProgramException: Invalid IL code in .: (int): IL_000a: dup
at Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection.Read () [0x00000]
at Mindscape.LightSpeed.LightSpeedContext. () [0x00000]
at Mindscape.LightSpeed.LightSpeedContext..cctor () [0x00000]
--- End of inner exception stack trace ---
at Class1.Host (System.Object& $retval) [0x00000]
at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) [0x00000]
at Mono.CSharpShell.Evaluate (System.String input) [0x00000]
csharp> quit;
null
---
Is this something that you have encountered and/or fixed in your nightly builds? Are there any known workarounds?
|
|
|
Hmmm...I didn't realize that the forum wouldn't respect line breaks, let's try that again:
Mono C# Shell, type "help;" for help Enter statements below. csharp> LoadAssembly("Mindscape.LightSpeed"); csharp> Mindscape.LightSpeed.LightSpeedContext.Default; System.TypeInitializationException: An exception was thrown by the type initializer for Mindscape.LightSpeed.LightSpeedContext ---> System.InvalidProgramException: Invalid IL code in .: (int): IL_000a: dup at Mindscape.LightSpeed.Configuration.LightSpeedConfigurationSection.Read () [0x00000] at Mindscape.LightSpeed.LightSpeedContext. () [0x00000] at Mindscape.LightSpeed.LightSpeedContext..cctor () [0x00000] --- End of inner exception stack trace --- at Class1.Host (System.Object& $retval) [0x00000] at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) [0x00000] at Mono.CSharpShell.Evaluate (System.String input) [0x00000] csharp> quit; null |
|
|
We made some fixes in nightly builds beginning 14 Feb to address this issue. If you're using 2.2 RTM or a pre-14 Feb nightly (build number less than 10530 in the DLL version), could you upgrade to a current nightly and try again? Otherwise, let us know and we'll check this out. |
|
|
Is there a version of the nightly build that isn't an MSI, or do I have to go find a friend running Windows?
|
|
|
At the moment it's MSI only. Sorry. If you don't have a Windows box handy, let us know which edition you're using (Express?) and we'll see if we can arrange something for you. |
|
|
We're using the Enterprise Edition, and the nightly build did the trick, although mono now outputs messages about missing Amazon.SimpleDB, Lucene.Net, andMemcached.ClientLibrary (we don't ship with those). Also, as a side note, we can't even build our product without Lucene.Net and Memcached.ClientLibrary being present in the same directory as Mindscape.LightSpeed.dll (gmcs crashes); it would be great if this could be addressed at some point, too.
|
|
|
Hi guys, I would be keen to help look in to some of these issues. Would you be able to provide a small sample which generates the crash you are seeing? If you are able to email it through to the support email address that would greatly help us with determining whats going on :) We have been using Mono 2.2 for our testing here and havnt run into any compilation issues where only the Mindscape.LightSpeed and Mindscape.LightSpeed.Linq assemblies are the only ones in play, so would be keen to determine why those others are required (Im assuming you are not using the search or caching providers of course) :)
Jeremy |
|
|
I've narrowed down the scope of the problem to something that I hope you'll find relatively easy to reproduce and investigate. Here are the instructions:
That's it. It seems that compiling any assembly marked as CLSCompliant that refers to Mindscape.LightSpeed.dll will result in the compiler throwing an unhandled exception as it tries to do some kind of extra validation on the referenced dlls. Do you still want me to send an e-mail to your support address, or is this description sufficient? |
|
|
Indeed - looks very easy to repro ;) Thanks for taking the time to investigate this one further, we will start having a look into this today :)
Jeremy |
|
|
Pure curiosity, why bother with obfuscation if you have a source code license available? Doesn't seem like it'd provide much benefit in such a case. (I ran into the same sort of problem with VistaDB on Mono -- they just ended up removing obfuscation. (Even more fun, the obfuscator used did a dumb job at reducing the assembly size. A 15 line script using Cecil was able to shave off 10% of the entire DLL easily.)) |
|