SSIS Error COde 0xC0202020: The buffer type is not valid. Make sure the Pipeline layout and all components pass validation
<p>I have developed a package to find the data that is truncated.
I have excel and csv files as sources. I have given redirect row on error and truncation in the source.The destination I have given as script component where I am updating the variable value. It is working fine in local development environment but not working in Server. I am getting the "The buffer type is not valid. Make sure the Pipeline layout and all components pass validation.
Error Code : 0xC0202020" 
I tried the following ways:
1) In both 32 as well as 64 bit machine versions.
2) Replacing the script component with Row count transform.
3) Running the package as administrator.
4) Refreshing the connection managers and columns
None of them worked for me and facing the same issue. How to solve this issue. </p>