‘Internal CPS Error’ When Adding A Project Reference


Edit: This is now a confirmed VS bug.

Occasionally I get this –

image

– 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”>
<Project>{66d572b3-b340-47dc-94fe-93515aebaaf4}</Project>
</ProjectReference>

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. Unknown's avatar Anonymous says:

    Worked like a champ! Thanks for sharing

  2. Unknown's avatar Anonymous says:

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

  3. Unknown's avatar Anonymous says:

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

    Costya

    P.S. Works perfectly!

  4. Eugene's avatar Eugene says:

    Thanks a lot!

  5. Unknown's avatar Anonymous says:

    good man!

  6. Unknown's avatar Alphadexx says:

    Great, resolved my issue! tnx

  7. Unknown's avatar 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 comment