‘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.

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

7 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!

    Costya

    P.S. Works perfectly!

  4. Eugene says:

    Thanks a lot!

  5. Anonymous says:

    good man!

  6. Alphadexx says:

    Great, resolved my issue! tnx

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 )

Google+ photo

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

Connecting to %s