HOWTO: Launch LocalServer Components(EXEs) from ASP (IIS 4.0)ID: Q184682
|
Although most ActiveX Server components are dynamic-link libraries (DLLs),
it is sometimes necessary to launch an EXE file from Active Server Pages
(ASP). When Server.CreateObject is used to launch an EXE file, an error
similar to the following may occur:
Server object error 'ASP 0196 : 80040154'
Cannot launch out of process component
/test/test.asp, line 12
Only InProc server components should be used. If you want to use
LocalServer components, you must set the AspAllowOutOfProcComponents
metabase setting. Please consult the help file for important
considerations.
This error is the result of a safety mechanism in Active Server Pages that
prevents the launching of LocalServer components. This mechanism is in
place because there are security concerns you should consider when
launching out-of-process components. In addition to the security concerns,
DLLs are also preferred because of their performance benefits over EXEs,
and their ability to be hosted by Microsoft Transaction Server (MTS).
To override this safety mechanism, you must change the value in the
AspAllowOutOfProcComponents metabase setting to TRUE. This metabase setting
is accessible through the IIsWebService and IIsWebVirtualDir Admin objects.
<%
' Get the IIsWebService Admin Object
Set WebServObj = GetObject("IIS://LocalHost/W3svc")
' Enable the AspAllowOutOfProcComponents Parameter
WebServObj.Put "AspAllowOutOfProcComponents", True
' Save the changed value to the metabase
WebServObj.SetInfo
%>
<%
' Get the IIsWebVirtualDir Admin Object
Set VDirObj = GetObject("IIS://LocalHost/W3svc/1/Root/vdir_name")
' Enable the AspAllowOutOfProcComponents Parameter
VDirObj.Put "AspAllowOutOfProcComponents", True
' Save the changed value to the metabase
VDirObj.SetInfo
%>
c:\> net stop iisadmin /y
c:\> net start w3svc
For more information on the issues surrounding launching LocalServers from
ASP, refer to the Internet Information Server (IIS) Release Notes under the
"Other Known Problems and Limitations" section.
For more information on the IIS Admin objects, refer to the IIS
Programmer's Reference under the IIS Administration topic.
This article applies to IIS 4.0. For additional information on IIS 3.0,
please see the following article in the Microsoft Knowledge Base:
Q175166 Launching LocalServer Components(EXEs) from ASP (IIS 3.0)
Additional query words: AspAllowOutOfProcComponents OutProc
Keywords : kberrmsg kbASP kbASPObj kbCOMt kbScript kbSecurity kbGrpASP
Version : winnt:4.0
Platform : winnt
Issue type : kbhowto
Last Reviewed: August 9, 1999