Robert G
Robert G

Reputation: 61

Strongly-typed assembly not being found despite being correctly referenced

We have a project which utilizes Sharp Architecture. For the purposes of some testing, we made some adjustments to strongly type some assemblies.

Following this, the project would no longer build. VS2010 complained that:

error CS0012: The type 'SharpArch.Core.PersistenceSupport.IRepositoryWithTypedId`2' is defined in an assembly that is not referenced. You must add a reference to assembly 'SharpArch.Core, Version=1.5.0.0, Culture=neutral, PublicKeyToken=b5f559ae0ac4e006'.

The reference has been removed and re-added. It's also in the GAC and we've verified that the Public Key Token matches.

Upvotes: 1

Views: 339

Answers (2)

Masoud Tabatabaei
Masoud Tabatabaei

Reputation: 269

Just check if you are running in x64 mode. Otherwise things will not work. Go to the vs project properties and change it to x64.

Upvotes: 1

Jonathan Allen
Jonathan Allen

Reputation: 70327

This is my checklist with the most likely cause on top.

  1. Make sure your project is not set to ".NET x.x CLIENT Framework". This one gets me all the time.
  2. Try cleaning your solution. I find that VS gets confused sometimes and needs you to clear out the obj/bin folders.
  3. Restart VS
  4. Set the reference to copy locally.
  5. Change it so that it doesn't request a specific version.
  6. Change it so that it does request a specific version.
  7. Remove the reference to the GAC version and add one to a version stored in a file.

Upvotes: 0

Related Questions