Documentation Center

Disposal of the built-in .NET Core Service client

You can dispose the client explicitly using the Dispose method, or by enclosing your Core Service code in a using statement.

Dispose method

To explicitly dispose the client, make the following call:

CoreServiceClient.Dispose();

or, when using the Import and Export client:

ImportExportClient.Dispose();
using method

Alternatively, enclose your client code in a using statement as follows:

using(CoreServiceClient client = new CoreServiceClient("ENDPOINTNAME"))
{
  // Insert your Core Service client code here
}

This causes the client to be disposed after the code has been executed.