Valhalla Legends Forums Archive | .NET Platform | System.ExecutionEngineException

AuthorMessageTime
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)
[/quote]

[code]
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);
      }
   }
}

[/code]
March 4, 2004, 4:52 AM
Myndfyr
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:

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

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:

[code]
[assembly: AssemblyCulture("")]
[/code]

Sorry K!
March 4, 2004, 6:03 PM
K
[quote author=Myndfyre link=board=37;threadid=5581;start=0#msg47435 date=1078423389]
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:

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

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:

[code]
[assembly: AssemblyCulture("")]
[/code]

Sorry K!
[/quote]

This is weird. Maybe I need to reinstall the framework.
March 5, 2004, 3:31 AM

Search