WindowsServerSolutionsEnvironment.Initialize Method ()
Initializes the Windows Server Solutions environment.
Namespace: Microsoft.WindowsServerSolutions.Common
Assembly: ProviderFramework (in ProviderFramework.dll)
Syntax
public static void Initialize()
public:
static void Initialize()
Public Shared Sub Initialize
Remarks
The majority of assemblies in the Home and Small Business Server SDK are not placed in the Global Assembly Cache (GAC). This can cause a problem for applications that are running in directories other than the directory in which the assemblies are running. To address this scenario, an application must initialize the Windows Server Solutions environment with a call to the Initialize function. This allows the application to correctly resolve any dependencies on assemblies that are not in the GAC.
The Initialize function must be called before any other Windows Server Solution SDK function calls. Additionally, the Initialize function call must be made in a method that does not call other Windows Server Solutions SDK functions. Therefore, if your initialization routine also initializes other Windows Server Solutions SDK components, move the calls after the Initialize call to a separate function. The following code snippet illustrates this point:
public void InitializeWindowsServerSolutions()
{
// Initialize Windows Server Solutions environment.
WindowsServerSolutionsEnvironment.Initialize();
// Continue initializing other components in a separate function.
InitializeWindowsServerSolutionsContinued();
}
private void InitializeWindowsServerSolutionsContinued()
{
NetworkHealthEngine engine = new NetworkHealthEngine();
}
See Also
WindowsServerSolutionsEnvironment Class
Microsoft.WindowsServerSolutions.Common Namespace
Return to top