The error refers to a .NET 4.0 assembly, probably your Dynamics CRM 4.0 environment has not been updated to (at least) rollup 18, the minimum rollup that support .NET 4.0, as stated here:
Microsoft Dynamics CRM Compatibility List
If the CRM has a lower rollup it supports only .NET 3.0/.NET 3.5