I've created a trivial class in a VisualAPL class library, which is being used in a Web Project.
When I try and create an instance of this object, either in unit tests, or in the web application itself, I get the message "An exception of type 'System.TypeInitializationException' occurred in MyNameSpace.DLL but was not handled in user code. Additional information: The type initializer for 'APLNext.APL.Objects.ReflectedPackage' threw an exception".
If I let execution continue, the error that comes up on my web page is "ActiveX control '8856f961-340a- ... tons more numbers here' cannot be instantiated because the current thread is not in a single-threaded apartment."
Source Error:
Line 1: #region Using directives
Line 2:
Line 3: using System; <== This line is in red, indicating the line the error is on.
Line 4: using System.Data
If I write the class in C# (it's trivial, right now), and do exactly the same things, I get no errors. As far as I know, this is just plain vanilla code, and I'm not doing anything remotely complicated.
Help!
Chris.