PFN_WEB_CORE_ACTIVATE Function

Starts an instance of the Hosted Web Core.

Syntax

typedef HRESULT (*PFN_WEB_CORE_ACTIVATE)(  
   IN PCWSTR pszAppHostConfigFile,  
   IN PCWSTR pszRootWebConfigFile,  
   IN PCWSTR pszInstanceName  
);  

Parameters

pszAppHostConfigFile
A pointer to a string that contains the path of a configuration file.

pszRootWebConfigFile
A pointer to a string that contains the path of a root Web.config file. (Optional)

pszInstanceName
A pointer to a string that contains the name of the instance that will be used for event logging.

Return Value

An HRESULT. Possible values include, but are not limited to, those in the following table.

Value Description
S_OK Indicates that the operation was successful.
ERROR_SERVICE_ALREADY_RUNNING Indicates that an instance of the Hosted Web Core is already running in the process.
ERROR_INVALID_DATA Indicates that a configuration error occurred in the configuration file.

Note

If the PFN_WEB_CORE_ACTIVATE function returns an ERROR_INVALID_DATA message, the Event Viewer may contain additional details regarding the cause of the failure.

Remarks

The PFN_WEB_CORE_ACTIVATE function is a prototype for the WebCoreActivate DLL entry point in Hwebcore.dll that is used to start the Hosted Web Core. The process that hosts the Web core is required to provide the path of a configuration file that contains the configuration settings for any sites, the application pool, and so on, that are to be created.

Note

The Hosted Web Core requires a configuration file that follows the design of the ApplicationHost.config file, except that Hosted Web Core supports only one application pool. For more information about how to create a configuration file for your application, see Walkthrough: Creating a Configuration File for Hosted Web Core.

This function also requires the name of the instance of the Hosted Web Core that IIS 7 uses when it logs events to the Event Viewer. The hosting process may optionally provide the path of a root Web.config file that contains any additional parameters.

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0
- IIS Express 7.5, IIS Express 8.0, IIS Express 10.0
Header Hwebcore.h

See Also

Hosted Web Core API Reference
PFN_WEB_CORE_SHUTDOWN Function