I am using the Integration Services api to successfully start an SSIS package in the SSISDB. I would like to be able to cancel the package while it is running. The documentation describes a Stop() method on RunningPackage objects that should accomplish this but I have two issues:
Calling Application.GetRunningPackages(serverName) always fails. I have integration services configured for a named instance but when I pass in (local)\myInstance as the argument then I get the error below:
SSIS service does not support multi-instance, use just server name instead of \"server name\\instance\"
If I only pass the server name or pass null like the example I get an error like below:
The specified service does not exist as an installed service.
How do I successfully get this to return RunningPackages for my named instance?
Assuming I can get that to return RunningPackages I then need to determine which one I want to cancel. A RunningPackage has an InstanceID property which sounds like what I want, however when I initially execute the package I see no way to get this InstanceID. To start executing the package I call SSISPackageDetail.PackageInfo.Execute() which returns an identifier but it's a Long while InstanceID is a Guid. How do I get this InstanceID so that I can cancel the correct package?