If the error occurs inside a , you may be locking variables incorrectly.
// Writing Dts.Variables["User::MyVar"].Value = "New Value"; ssis181 fixed