PRB: Calling Third-Party Component Fails from Active Server Pages (243603)



The information in this article applies to:

  • Microsoft Active Server Pages, when used with:
    • Microsoft Internet Information Server 3.0
    • Microsoft Internet Information Server 4.0

This article was previously published under Q243603

SYMPTOMS

When calling third-party Component Object Model (COM) components either directly from Active Server Pages (ASP) or indirectly through ASP using COM wrappers, the component does not behave as expected. The component may work correctly when called from a desktop client such as a Visual Basic or Visual C++ client form.

CAUSE

Many components are not designed to be called from ASP or to run in a multi-threaded environment under a service.

MORE INFORMATION

Typically one or more of the following issues may cause third-party components to fail or behave unexpectedly when called under ASP:
  • The component was designed for desktop use.
  • The component requires a specific security context.
  • The component requires a user interface or a host container.
  • The component was not designed to be used in a multi-threaded environment
  • The component expects a single thread of execution.
In general, you should use the following guidelines:
  1. Confirm with the development company of the third-party component that the component is designed to work under ASP.
  2. Confirm that the threading model of the component is safe for use under ASP. Single threaded components should not called from ASP because they do not marshal security context, and they lock the application down to a single thread of execution. Only Apartment (STA), Free, and Both threaded components can be used safely from ASP.
  3. Confirm that the component implements IDispatch. Working from ASP includes implementing IDispatch and the component needs to be thread-safe because ASP is a multi-threaded automation client.

    Tip: If the third-party component information is not available directly from the development company, you can call the component from a Visual Basic client using late-binding (for example, Dim objServer as Object) to test IDispatch functionality. You can also inspect the registry for type information.
In general, Microsoft support boundaries include the following:
  1. Explaining the behavior of ASP as a multithreaded COM client:
    • Security implications running under Internet Information Server (IIS) as opposed to a desktop application
    • Threading guidelines under ASP
    • Scalability issues
  2. Assisting in problem isolation to determine if the problem lies within the third-party component.

REFERENCES

For additional information, click the article numbers below to view the articles in the Microsoft Knowledge Base:

243544 INFO: Component Threading Model Summary Under ASP

243548 INFO: Design Guidelines for VB Components Under ASP


Modification Type:MajorLast Reviewed:11/17/2003
Keywords:kb3rdparty kbprb kbThread KB243603