• Welcome to Valhalla Legends Archive.
 

System.ExecutionEngineException

Started by K, March 03, 2004, 10:52 PM

Previous topic - Next topic

K

Perhaps someone else could run this code and tell me if it throws an error for them.  I am using the .NET Framework 1.1 and it dies on the marked line with this:

Quote
An unhandled exception of type 'System.ExecutionEngineException' occurred in mscorlib.dll (no additional information)


using System;
using System.Globalization;

namespace Test
{
   class CTest
   {
      [STAThread]
      static void Main(string[] args)
      {
         CultureInfo c = CultureInfo.CurrentCulture;
         RegionInfo r = RegionInfo.CurrentRegion;
         // or
         // RegionInfo r = new RegionInfo(c.LCID);

         // Any reference to any property of r will cause this exception.
         Console.WriteLine(r.Name);
      }
   }
}


MyndFyre

#1
I haven't had a chance to test this, as I am at school right now on a PDA.  However, a thought comes to mind...

By default, .NET assemblies are compiled culture-neutral.  Check your AssemblyInfo.cs for an attribute that deals with the current culture.   I believe it is:


[assembly: CurrentCulture(1033)]
// or
[assembly: CurrentCulture("EN-US")]


This will have nothing in its constructor by default.  I don't remember what the constructor parameters can be, but I think both above are valid.  1033 is the code for United States English.  :)

Hope that helps you out.  I'll check it when I get out of class.

Edit: Nope, I was wrong.  It compiles and executes fine, outputting "US\n" to the console.

I was also wrong about the attribute. By default, it has an empty string in its constructor:


[assembly: AssemblyCulture("")]


Sorry K!
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

K

Quote from: Myndfyre on March 04, 2004, 12:03 PM
I haven't had a chance to test this, as I am at school right now on a PDA.  However, a thought comes to mind...

By default, .NET assemblies are compiled culture-neutral.  Check your AssemblyInfo.cs for an attribute that deals with the current culture.   I believe it is:


[assembly: CurrentCulture(1033)]
// or
[assembly: CurrentCulture("EN-US")]


This will have nothing in its constructor by default.  I don't remember what the constructor parameters can be, but I think both above are valid.  1033 is the code for United States English.  :)

Hope that helps you out.  I'll check it when I get out of class.

Edit: Nope, I was wrong.  It compiles and executes fine, outputting "US\n" to the console.

I was also wrong about the attribute. By default, it has an empty string in its constructor:


[assembly: AssemblyCulture("")]


Sorry K!

This is weird.  Maybe I need to reinstall the framework.