This post giving one of the possible solution to resolve the error above.
You have a Script Task in SSIS and utilizing the Connection Manager. The Connection Manager Provider type is Native OLE DB\SQL Server Native Client 11.0.
You have code inside the Script Task.
cm = Dts.Connections[“LocalHost.uCustoms”];
sqlConn = (SqlConnection)cm.AcquireConnection(Dts.Transaction);
You get the error
“System.InvalidCastException was unhandled by user code
Message=Unable to cast COM object of type ‘System.__ComObject’ to class type ‘System.Data.SqlClient.SqlConnection’. Instances of types that represent COM components cannot be cast to types that do not represent COM components; however they can be cast to interfaces as long as the underlying COM component supports QueryInterface calls for the IID of the interface.
You need to change your Connection Manager to .NET Provider\SqlClient Data Provider.