ProviderServiceBase.OnStart Method (String[])
This method is called when the Windows Service is started.
Namespace: Microsoft.WindowsServerSolutions.Common.ProviderFramework
Assembly: ProviderFramework (in ProviderFramework.dll)
Syntax
protected override void OnStart(
string[] args
)
protected:
virtual void OnStart(
array<String^>^ args
) override
Protected Overrides Sub OnStart (
args As String()
)
Parameters
args
Type: System.String[]The command-line arguments.
Remarks
Classes that are derived from the ProviderServiceBase class do not need to override this method unless they must run additional code when the service is started.
Important
Exceptions that occur from the OnStart method may not crash the process (System.ServiceProcess.ServiceBase catches them). If you override OnStart to implement additional behavior that is not already implemented by the ProviderServiceBase class, it is recommended that you catch any exception generated by your code to pass to Environment.FailFast. This improves the ability to debug your code. Otherwise, your service may appear to unexpectedly, but gracefully stop.
See Also
ProviderServiceBase Class
Microsoft.WindowsServerSolutions.Common.ProviderFramework Namespace
Return to top