‘Internal CPS Error’ When Adding A Project Reference

Edit: This is now a confirmed VS bug.

Occasionally I get this –


– when trying to add a reference from one project to another in VS2010. I’ve no idea what CPS is and what shim object they’re talking about, but I’ve discovered a hack around it.

Suppose you’ve encountered this error when trying to add a reference from projectA to projectB. Albeit cryptic, the message distinguishes an actual project reference (which VS found), from some internal representation or (more likely) satellite object, the shim object – which is missing.

To resolve this discrepancy edit projectA.vcxproj (you can unload projectA, right click it and choose ‘edit’, but notepad would do just fine). Locate and delete the lines that encode the existing reference to projectB:

<ProjectReference Include=”..\projectB\projectB.vcxproj”>

The discrepancy is fixed. Reload projectA in VS and merrily add the reference to projectB.

This entry was posted in Visual Studio. Bookmark the permalink.

9 Responses to ‘Internal CPS Error’ When Adding A Project Reference

  1. Anonymous says:

    Worked like a champ! Thanks for sharing

  2. Anonymous says:

    Thanks! Saved me some time. Don’t know why VS doesn’t just use the one it found.

  3. Anonymous says:

    Ofek, dude, this is unbelievable, I encountered this problem and you were the first result on Google. Small planet I guess!


    P.S. Works perfectly!

  4. Eugene says:

    Thanks a lot!

  5. Anonymous says:

    good man!

  6. Alphadexx says:

    Great, resolved my issue! tnx

  7. Anonymous says:

    Works, thanks! Was produced when I added a project reference A to my project B, then removed the referenced project A from the solution file and added it back after changing the referenced project A’s location.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s