Make sure that the "pin version" checkbox is set. Otherwise the project will open with different TwinCAT versions depending on what is installed on your computer.
Also compare (binary compare, not date compare!) if this folder on both laptops is identical (one can have more libraries than the other, but if they have both the same library versions, the files must be identical): C:\TwinCAT\3.1\Components\Plc\Managed Libraries
If both is fine there were several solutions in the past:
The error is known for some TwinCAT versions with OpconBase/NxBase object <=V1.0.13.0 (library <=V1.0.9.0) and OpconFbpPdpBase/NxFbpPdpBase object <=V2.0.60.0 (library <=V1.0.60.0) . Therefore an update could solve the problem.
Sometimes this also helped: Close TwinCAT > Start an export > Compile PLC project again.
One step further sometimes also helped: Close TwinCAT > Delete all Bosch libraries in C:\TwinCAT\3.1\Components\Plc\Managed Libraries > Start an export > Compile PLC project again.
Delete the TMC file in TwinCAT and compile the PLC project (which should re-create the TMC file): Hint: If creation of the TMC file still fails, your IO links will be lost after closing TwinCAT.
If you still could not solve it: Other libraries could be the causer (usually not the Bosch Connected Industry libraries).
Check for libraries that inlcude a TMC file (which should not be included in libraries):
The library creator must set and afterwards remove the checkbox "Minimize Id changes in TwinCAT files" (1). Then the creator must create a new library version:
If the error message is "Generating TMC failed! Value cannot be null. Parameter name: source" then you have to check all referenced libraries for unnecessary external types like ST_LibVersion. In the following library EdTimeStampBottleNeck by Bosch ED/MFT (BueP) this was the case:
... View more