Welcome to APLNext Sign in | Join | Help
in
Community Website
Blogs Forums

Error instantiating VisualAPL object

Last post 10-26-2007, 12:27 PM by Chris.McIntosh. 2 replies.
Sort Posts: Previous
  • Error instantiating VisualAPL object

     10-25-2007, 12:50 PM

    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.

  • Re: Error instantiating VisualAPL object

     10-26-2007, 5:28 AM

    Chris, I am slightly confused. Does your project compile without errors?

    If it does, I would expect to be able to create an instance of the class in another VS2005 project.

    If it does not, I woould guess you are missing a reference to one of the Visual APL DLLs: can't tell which one.

    With the web application, I assume you are using IIS; am I correct? If so, IIS will probably require some configuration to recognise the Visual APL libraries. You do not get any errors with C# probably because IIS is already configured to recognise Framework 2.0.

    Perhaps you can zip your project and attach it here?

    APLNext need to spell out how to deploy and troublshoot Visual APL assemblies.

  • Re: Error instantiating VisualAPL object

     10-26-2007, 12:27 PM

    I have got my project compiling without errors, and yes, I would also expect to be able to create an instance of the class in another VS2005 project.  I've done this before, so there must be something about this particular project it doesn't like.

    It could indeed be a web/IIS configuration problem.  I'll try and do a little more debugging here, such as creating a non-web project and using that class to see if I have the same problem, and also creating another web project (and maybe web site as well) and seeing if I still get the errors.  I'll also look into IIS configuration, although right now I'm using the built in VS web server.  I'm not using any component files or other "special" stuff, so I'm not sure I need any of the VisualAPL DLLs, but I'll look into this as well.

    If I don't get anywhere, then I'll zip up the project and attach it here.

    Thanks for the ideas.  Chris.

View as RSS news feed in XML
Powered by Community Server, by Telligent Systems