I am trying to read a package variable during design-time. I am able to do it during run-time fairly easily:
IDTSVariables variables = null;
pipelineComponent.VariableDispenser.LockForRead("MyVariable");
pipelineComponent.VariableDispenser.GetVariables(out variables);
But during design-time, I don’t have a PipelineComponent and I can’t find any object that will give me a VariableDispenser.
I’ve looked at the IDtsVariableService class, but it appears to only provide a helper UI to facilitate the creation of new variables — I want to read an existing variable.
Turns out I was close, it was the IDtsPipelineEnvironmentService class: